Minisign (minisign v0.1.1)
Elixir implementation of the Minisign signature verification format.
Summary
Functions
verifies a signature, returning :ok
if the signature is valid.
verifies a signature, and raises if any of the inputs are invalid.
Types
message_input()
public_key_input()
@type public_key_input() :: String.t() | {:file, Path.t()} | Minisign.PublicKey.t()
reason()
@type reason() :: :key_id_match | :signature | :global_signature
signature_input()
@type signature_input() :: String.t() | {:file, Path.t()} | Minisign.Signature.t()
Functions
verify(message, signature, public_key)
@spec verify(message_input(), signature_input(), public_key_input()) :: :ok | {:invalid, reason()} | {:error, any()}
verifies a signature, returning :ok
if the signature is valid.
if the signature is invalid, returns an :invalid
tuple indicating the
reason why the signature failed to validate.
if any of the inputs have failed, returns an :error
tuple.
For the key or signature inputs you may provide Base64 encoded strings, or a
{:file, path}
tuple to read from a file or a preparsed datastructure.
For the message input, you may either provide the raw binary or, a {:file, path}
tuple to read the message from the file.
verify!(message, signature, public_key)
@spec verify!(message_input(), signature_input(), public_key_input()) :: boolean()
verifies a signature, and raises if any of the inputs are invalid.