Karta. Auth. DKIM. KeyRecord
(Karta v1.0.0)
A DKIM public key record from DNS (RFC 6376 §3.6.1; RFC 8463 §4 for Ed25519), parsed and checked.
v=must beDKIM1when present;k=isrsa(the default) ored25519;h=, when present, must allowsha256;s=must includeemailor*;t=flagsy(testing) ands(strict identity).p=empty means the key was revoked.- RSA keys may be published as a SubjectPublicKeyInfo (the standard form) or as a bare RSAPublicKey (some publishers do); they must have at least 1024 bits (RFC 8301 §3.2) and at most 8192, and a public exponent below 2^32 (real keys use 65537; a huge exponent would make each verification as slow as a signature). Ed25519 keys are exactly 32 octets.
Summary
Functions
Parses a key record (the TXT record's strings joined).
True when signature is a valid signature of the header data under this key.
Types
@type error() ::
:syntax
| :bad_version
| :unknown_key_type
| :hash_not_allowed
| :service_not_allowed
| :revoked
| :bad_key
| :key_too_small
| :key_too_large
Why a record cannot be used; every one is a permanent error.
@type t() :: %Karta.Auth.DKIM.KeyRecord{ algorithm: :rsa | :ed25519, bits: pos_integer(), key: term(), strict: boolean(), testing: boolean() }