Karta. DANE. TLSA
(Karta v1.0.0)
TLSA records (RFC 6698) as DANE for SMTP uses them (RFC 7672, RFC 7671).
A record is {usage, selector, matching_type, data}, as Karta.DNS
returns it.
A record is usable for SMTP (RFC 7672 §3.1) when its usage is 2 (DANE-TA, a trust anchor in the server's chain) or 3 (DANE-EE, the server's own certificate), its selector 0 (the whole certificate) or 1 (its SubjectPublicKeyInfo), and its matching type 0 (the selected data itself), 1 (its SHA-256 digest, 32 bytes) or 2 (its SHA-512 digest, 64 bytes). Usages 0 and 1 (PKIX-TA, PKIX-EE), other values, empty data and a digest of the wrong length are unusable.
usable/1 also applies digest algorithm agility (RFC 7671 §9): for each
usage and selector, only the records with matching type 0 and those
with the strongest digest present (SHA-512 before SHA-256) count.
Summary
Functions
True when record matches the certificate der (DER): the whole
certificate or its SubjectPublicKeyInfo, compared as the record's
matching type says. A certificate that cannot be decoded matches
nothing.
The record in presentation form (RFC 6698 §2.2), for TLS reports:
"3 1 1 0a1b...", the data in lower-case hexadecimal.
The usable records of an RRset, after digest algorithm agility. See the module doc.
True for a record DANE for SMTP can use (before digest algorithm agility).
Types
@type t() :: {0..255, 0..255, 0..255, binary()}
Functions
True when record matches the certificate der (DER): the whole
certificate or its SubjectPublicKeyInfo, compared as the record's
matching type says. A certificate that cannot be decoded matches
nothing.
The record in presentation form (RFC 6698 §2.2), for TLS reports:
"3 1 1 0a1b...", the data in lower-case hexadecimal.
The usable records of an RRset, after digest algorithm agility. See the module doc.
True for a record DANE for SMTP can use (before digest algorithm agility).