View Source dnssec (dns_erlang v3.0.4)
Summary
Functions
Generates and appends a DNS Key records key tag.
Converts a resource record data record to DNSSEC canonical form.
Generate NSEC3 records from a list of #dns_rr{}.
Equivalent to gen_nsec3(RR, ZoneName, Alg, Salt, Iterations, TTL, in, []).
Generate NSEC records from a list of #dns_rr{}.
Equivalent to gen_nsec(ZoneName, RR, TTL, []).
Generate NSEC records.
NSEC3 iterative hash function
Equivalent to sign_rr(RR, SignerName, KeyTag, Alg, Key, []).
Signs a list of #dns_rr{}.
Equivalent to sign_rrset(RRSet, SignerName, KeyTag, Alg, Key, []).
Signs a list of #dns_rr{} of the same class and type.
Provides primitive verification of an RR set.
Types
-type gen_nsec3_opt() :: gen_nsec_opt().
-type gen_nsec_opt() :: {base_types, [dns:type()]}.
-type key() :: [binary()].
-type keytag() :: integer().
-type nsec3_hashalg() :: 1.
-type nsec3_iterations() :: non_neg_integer().
-type nsec3_salt() :: binary().
-type sigalg() :: 3 | 6 | 5 | 7 | 8 | 10.
-type sign_rr_opt() :: {inception | expiration, dns:unix_time()}.
-type verify_rrsig_opt() :: {now, dns:unix_time()}.
Functions
Generates and appends a DNS Key records key tag.
-spec canonical_rrdata_form(dns:rrdata()) -> dns:rrdata().
Converts a resource record data record to DNSSEC canonical form.
Generate NSEC3 records from a list of #dns_rr{}.
The list must contain a SOA #dns_rr{} to source the zone name and TTL from as well as as an NSEC3Param #dns_rr{} to source the hash algorithm, iterations and salt from.
-spec gen_nsec3([dns:rr()], dns:dname(), nsec3_hashalg(), nsec3_salt(), nsec3_iterations(), dns:ttl()) -> [dns:rr()].
Equivalent to gen_nsec3(RR, ZoneName, Alg, Salt, Iterations, TTL, in, []).
-spec gen_nsec3([dns:rr()], dns:dname(), nsec3_hashalg(), nsec3_salt(), nsec3_iterations(), dns:ttl(), dns:class()) -> [dns:rr()].
Equivalent to gen_nsec3(RRs, ZoneName, Alg, Salt, Iterations, TTL, Class, []).
Generate NSEC records from a list of #dns_rr{}.
The list must contain a SOA #dns_rr{} which is used to determine zone name and TTL.
Equivalent to gen_nsec(ZoneName, RR, TTL, []).
-spec gen_nsec(dns:dname(), [dns:rr()], dns:ttl(), [gen_nsec_opt()]) -> [dns:rr()].
Generate NSEC records.
-spec ih(nsec3_hashalg() | fun((binary()) -> binary()), nsec3_salt(), binary(), non_neg_integer()) -> binary().
NSEC3 iterative hash function
Equivalent to sign_rr(RR, SignerName, KeyTag, Alg, Key, []).
Signs a list of #dns_rr{}.
Equivalent to sign_rrset(RRSet, SignerName, KeyTag, Alg, Key, []).
-spec sign_rrset([dns:rr(), ...], dns:dname(), keytag(), sigalg(), key(), [sign_rr_opt()]) -> dns:rr().
Signs a list of #dns_rr{} of the same class and type.
-spec verify_rrsig(dns:rr(), [dns:rr()], [dns:rr()], [verify_rrsig_opt()]) -> boolean().
Provides primitive verification of an RR set.