DwmDns-0.1.0
Dwm::Dns::RRDataCERT Class Reference

Encapsulates CERT resource record data. More...

#include <DwmDnsRRDataCERT.hh>

Inheritance diagram for Dwm::Dns::RRDataCERT:
Collaboration diagram for Dwm::Dns::RRDataCERT:

Public Member Functions

 RRDataCERT ()
 Constructor.
 
 RRDataCERT (uint16_t type, uint16_t keyTag, uint8_t algorithm, const std::string &certificate)
 Construct a CERT with type, keyTag, algorithm and certificate. More...
 
bool operator== (const RRDataCERT &cert) const
 Equal-to operator, mostly for unit testing.
 
uint16_t Type () const
 Returns the type in the CERT resource record data.
 
uint16_t Type (uint16_t type)
 Sets and returns the type in the CERT resource record data.
 
uint16_t KeyTag () const
 Returns the key tag in the CERT resource record data.
 
uint16_t KeyTag (uint16_t keyTag)
 Sets and returns the key tag in the CERT resource record data.
 
uint8_t Algorithm () const
 Returns the algorithm in the CERT resource record data.
 
uint8_t Algorithm (uint8_t algorithm)
 Sets and returns the algorithm in the CERT resource record data.
 
const std::string & Certificate () const
 Returns the certificate in the CERT resource record data.
 
const std::string & Certificate (const std::string &certificate)
 Sets and returns the certificate in the CERT resource record data.
 
uint8_t * Encode (uint8_t *pkt, uint8_t *ptr, uint16_t pktlen, LabelPositions &lps) const
 Encodes the CERT resource record data into buffer @ pkt of length pktlen, starting at ptr. More...
 
const uint8_t * Decode (const uint8_t *pkt, const uint8_t *ptr, uint16_t pktlen, uint16_t rdlen)
 Decodes the CERT resource record data from buffer pkt of length pktlen, starting at ptr. More...
 

Static Public Attributes

static const uint16_t k_rrtype = 37
 
static const uint16_t k_typePKIX = 1
 
static const uint16_t k_typeSPKI = 2
 
static const uint16_t k_typePGP = 3
 
static const uint16_t k_typeIPKIX = 4
 
static const uint16_t k_typeISPKI = 5
 
static const uint16_t k_typeIPGP = 6
 
static const uint16_t k_typeACPKIX = 7
 
static const uint16_t k_typeIACPKIX = 8
 
static const uint16_t k_typeURI = 253
 
static const uint16_t k_typeOID = 254
 
static const uint8_t k_algorithmReserved = 0
 
static const uint8_t k_algorithmRSAMD5 = 1
 
static const uint8_t k_algorithmDH = 2
 
static const uint8_t k_algorithmDSA = 3
 
static const uint8_t k_algorithmECC = 4
 

Friends

std::ostream & operator<< (std::ostream &os, const RRDataCERT &cert)
 Print the CERT resource record data to an ostream in human readable form. More...
 

Detailed Description

Encapsulates CERT resource record data.

See RFC 4398 for details.

Constructor & Destructor Documentation

◆ RRDataCERT()

Dwm::Dns::RRDataCERT::RRDataCERT ( uint16_t  type,
uint16_t  keyTag,
uint8_t  algorithm,
const std::string &  certificate 
)

Construct a CERT with type, keyTag, algorithm and certificate.

Member Function Documentation

◆ Decode()

const uint8_t* Dwm::Dns::RRDataCERT::Decode ( const uint8_t *  pkt,
const uint8_t *  ptr,
uint16_t  pktlen,
uint16_t  rdlen 
)
virtual

Decodes the CERT resource record data from buffer pkt of length pktlen, starting at ptr.

Returns the address immediately following the encoded CERT resource record data in pkt on success. Throws std::out_of_range if pkt was too short to contain an encoded CERT resource record data.

Implements Dwm::Dns::RRData.

◆ Encode()

uint8_t* Dwm::Dns::RRDataCERT::Encode ( uint8_t *  pkt,
uint8_t *  ptr,
uint16_t  pktlen,
LabelPositions lps 
) const
virtual

Encodes the CERT resource record data into buffer @ pkt of length pktlen, starting at ptr.

Returns the address immediately following the encoded CERT resource record data in pkt on success. Throws std::out_of_range if pkt is too short to contain the encoded CERT resource record data.

Implements Dwm::Dns::RRData.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const RRDataCERT cert 
)
friend

Print the CERT resource record data to an ostream in human readable form.


The documentation for this class was generated from the following file: