Verifies the DKIM-Signature: fields of a message whose body is
hashed as it streams by (RFC 6376 §6).
verifier = Sovite.DKIM.Verifier.new(fields)
body = Sovite.DKIM.Body.new(Sovite.DKIM.Verifier.body_specs(verifier))
body = Sovite.DKIM.Body.update(body, chunk) # for each body chunk
results = Sovite.DKIM.Verifier.finish(verifier, Sovite.DKIM.Body.finish(body), resolver)Results are in the order of the signatures in the header, top first.
Summary
Functions
The body hashes the signatures need.
Checks each signature, looking up keys with resolver.
Reads the signatures of header fields.
Types
@type t() :: %Sovite.DKIM.Verifier{ fields: [Sovite.Message.Headers.field()], signatures: [ {:ok, Sovite.DKIM.Signature.t()} | {:error, String.t(), String.t()} ] }
Functions
@spec body_specs(t()) :: [Sovite.DKIM.Body.spec()]
The body hashes the signatures need.
@spec finish( t(), %{required(Sovite.DKIM.Body.spec()) => {binary(), non_neg_integer()}}, Sovite.DNS.resolver() ) :: [Sovite.DKIM.Result.t()]
Checks each signature, looking up keys with resolver.
@spec new([Sovite.Message.Headers.field()], keyword()) :: t()
Reads the signatures of header fields.
Options
:max_signatures- signatures beyond this many are ignored, so a message cannot make the verifier do unbounded work. Defaults to 10.:now- Unix seconds, for expired signatures. Defaults to now.