plug_signature v0.7.0 PlugSignature.Crypto View Source

This module exposes the cryptographic core functions used in HTTP signatures. These functions may be used to implement clients, or alternative server-side implementations, e.g. for Raxx.

Supported algorithms:

  • 'hs2019', using ECDSA, RSASSA-PSS or HMAC (all with SHA-512)
  • 'rsa-sha256', using RSASSA-PKCS1-v1_5
  • 'rsa-sha1', using RSASSA-PKCS1-v1_5
  • 'ecdsa-sha256'
  • 'hmac-sha256'

Link to this section Summary

Functions

Generates a signature.

Generates a signature. Raises in case of an error.

Verifies a signature value. Raises in case of errors.

Link to this section Functions

Link to this function

sign(payload, algorithm, private_key)

View Source

Generates a signature.

Returns {:ok, signature} or {:error, reason}.

Link to this function

sign!(payload, binary, private_key)

View Source

Generates a signature. Raises in case of an error.

Link to this function

verify(payload, algorithm, signature, public_key)

View Source
Link to this function

verify!(payload, binary, signature, public_key)

View Source

Verifies a signature value. Raises in case of errors.