dnsbase
Copyright(c) Viktor Dukhovni 2026
LicenseBSD-3-Clause
Maintainerietf-dane@dukhovni.org
Stabilityunstable
Safe HaskellNone
LanguageGHC2024

Net.DNSBase.RData.TLSA

Description

Four DANE-style records that publish cryptographic identifiers via DNS. T_tlsa (RFC 6698) carries TLS certificate associations; T_smimea (RFC 8162) carries the same for S/MIME — both share the wire format of the underlying X_tlsa representation. T_sshfp (RFC 4255) carries SSH host-key fingerprints. T_openpgpkey (RFC 7929) carries an OpenPGP transferable public key.

Synopsis

TLSA and SMIMEA

data X_tlsa (n :: Nat) Source #

Shared wire-format representation for DANE certificate-binding records: the TLSA record (RFC 6698 section 2.1, DANE for TLS) and the SMIMEA record (RFC 8162 section 2, DANE for S/MIME). The type parameter n (either N_tlsa or N_smimea) determines the RR type. Each has its own type synonym (T_tlsa, T_smimea) and matching record pattern synonym (T_TLSA, T_SMIMEA) with the corresponding field-name prefix (tlsa, smimea). The role of X_tlsa is nominal: the wire format is shared but the two RR types bind to different protocols, so T_tlsa and T_smimea are not coercible.

                     1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  Cert. Usage  |   Selector    | Matching Type |               /
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+               /
/                                                               /
/                 Certificate Association Data                  /
/                                                               /
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

If a received message carries a payload shorter than 3 bytes the record is returned as an opaque RData of the corresponding RRTYPE with the truncated bytes as its value; DANE validators should treat such records as present but "unusable".

Derived Ord is canonical (RFC 4034 section 6.2).

See T_sshfp for the SSH host-key fingerprint record and T_openpgpkey for the OpenPGP key record — both also live in this module.

Constructors

X_TLSA 

Fields

Bundled Patterns

pattern T_TLSA

Record pattern synonym viewing the shared X_tlsa record as a TLSA (DANE for TLS) record, RFC 6698. Fields: tlsaUsage, tlsaSelector, tlsaMtype, tlsaAssocData. Not coercible to/from T_smimea: the role of X_tlsa is nominal because TLSA and SMIMEA bind to different protocols and the shared wire format is coincidental.

Fields

pattern T_SMIMEA

Record pattern synonym viewing the shared X_tlsa record as an SMIMEA (DANE for S/MIME) record, RFC 8162. Fields: smimeaUsage, smimeaSelector, smimeaMtype, smimeaAssocData. Not coercible to/from T_tlsa (see T_TLSA note).

Fields

Instances

Instances details
KnownSymbol (XtlsaConName n) => Presentable (X_tlsa n) Source # 
Instance details

Defined in Net.DNSBase.RData.TLSA

(Nat16 n, KnownSymbol (XtlsaConName n)) => KnownRData (X_tlsa n) Source # 
Instance details

Defined in Net.DNSBase.RData.TLSA

Associated Types

type RDataExtensionVal (X_tlsa n) 
Instance details

Defined in Net.DNSBase.RData.TLSA

Methods

rdataExtensionVal :: forall b -> b ~ X_tlsa n => RDataExtensionVal (X_tlsa n) Source #

rdType :: forall b -> b ~ X_tlsa n => RRTYPE Source #

rdTypePres :: forall b -> b ~ X_tlsa n => Builder -> Builder Source #

rdDecode :: forall b -> b ~ X_tlsa n => RDataExtensionVal (X_tlsa n) -> Int -> SGet RData Source #

rdEncode :: X_tlsa n -> SPut s RData Source #

cnEncode :: X_tlsa n -> SPut s RData Source #

(Nat16 n, KnownSymbol (XtlsaConName n)) => Show (X_tlsa n) Source # 
Instance details

Defined in Net.DNSBase.RData.TLSA

Methods

showsPrec :: Int -> X_tlsa n -> ShowS #

show :: X_tlsa n -> String #

showList :: [X_tlsa n] -> ShowS #

KnownSymbol (XtlsaConName n) => Eq (X_tlsa n) Source # 
Instance details

Defined in Net.DNSBase.RData.TLSA

Methods

(==) :: X_tlsa n -> X_tlsa n -> Bool #

(/=) :: X_tlsa n -> X_tlsa n -> Bool #

KnownSymbol (XtlsaConName n) => Ord (X_tlsa n) Source # 
Instance details

Defined in Net.DNSBase.RData.TLSA

Methods

compare :: X_tlsa n -> X_tlsa n -> Ordering #

(<) :: X_tlsa n -> X_tlsa n -> Bool #

(<=) :: X_tlsa n -> X_tlsa n -> Bool #

(>) :: X_tlsa n -> X_tlsa n -> Bool #

(>=) :: X_tlsa n -> X_tlsa n -> Bool #

max :: X_tlsa n -> X_tlsa n -> X_tlsa n #

min :: X_tlsa n -> X_tlsa n -> X_tlsa n #

type RDataExtensionVal (X_tlsa n) Source # 
Instance details

Defined in Net.DNSBase.RData.TLSA

type family XtlsaConName (n :: Nat) :: Symbol where ... Source #

Equations

XtlsaConName N_tlsa = "T_TLSA" 
XtlsaConName N_smimea = "T_SMIMEA" 
XtlsaConName n = TypeError ('ShowType n ':<>: 'Text " is not a TLSA or SMIMEA RRTYPE") :: Symbol 

type T_tlsa = X_tlsa N_tlsa Source #

X_tlsa specialised to TLSA records.

type T_smimea = X_tlsa N_smimea Source #

X_tlsa specialised to SMIMEA records.

T_TLSA fields

T_SMIMEA fields

SSHFP

data T_sshfp Source #

The SSHFP resource record (RFC 4255 section 3.1) — a fingerprint of an SSH host public key. Three fields: an 8-bit algorithm tag (matches the SSH key algorithm), an 8-bit fingerprint type tag (SHA-1, SHA-256, ...), and the fingerprint bytes.

                    1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|   algorithm   |    fp type    |                               /
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               /
/                                                               /
/                          fingerprint                          /
/                                                               /
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

See X_tlsa / T_openpgpkey for the other DANE-style records in this module.

Instances

Instances details
Presentable T_sshfp Source # 
Instance details

Defined in Net.DNSBase.RData.TLSA

KnownRData T_sshfp Source # 
Instance details

Defined in Net.DNSBase.RData.TLSA

Associated Types

type RDataExtensionVal T_sshfp 
Instance details

Defined in Net.DNSBase.RData.TLSA

Show T_sshfp Source # 
Instance details

Defined in Net.DNSBase.RData.TLSA

Eq T_sshfp Source # 
Instance details

Defined in Net.DNSBase.RData.TLSA

Methods

(==) :: T_sshfp -> T_sshfp -> Bool #

(/=) :: T_sshfp -> T_sshfp -> Bool #

Ord T_sshfp Source # 
Instance details

Defined in Net.DNSBase.RData.TLSA

type RDataExtensionVal T_sshfp Source # 
Instance details

Defined in Net.DNSBase.RData.TLSA

OPENPGPKEY

data T_openpgpkey Source #

The OPENPGPKEY resource record (RFC 7929 section 2.2) — an OpenPGP transferable public key, carried as raw bytes (no ASCII armor, no base64). Single-field; presented in base64 form.

See X_tlsa / T_sshfp for the other DANE-style records in this module.

Constructors

T_OPENPGPKEY 

Instances

Instances details
Presentable T_openpgpkey Source # 
Instance details

Defined in Net.DNSBase.RData.TLSA

KnownRData T_openpgpkey Source # 
Instance details

Defined in Net.DNSBase.RData.TLSA

Associated Types

type RDataExtensionVal T_openpgpkey 
Instance details

Defined in Net.DNSBase.RData.TLSA

Show T_openpgpkey Source # 
Instance details

Defined in Net.DNSBase.RData.TLSA

Eq T_openpgpkey Source # 
Instance details

Defined in Net.DNSBase.RData.TLSA

Ord T_openpgpkey Source # 
Instance details

Defined in Net.DNSBase.RData.TLSA

type RDataExtensionVal T_openpgpkey Source # 
Instance details

Defined in Net.DNSBase.RData.TLSA