dxd - dynax driver framework 3.0.0d222
cross platform open source driver development framework
Loading...
Searching...
No Matches
dx::der Namespace Reference

ASN.1 DER, walked in place: what a certificate's fields and a license's private extensions take. More...

Classes

struct  tlv
 one element: its tag, content, the element behind it and its own start (begin..next is the whole element, what a signature covers) More...

Enumerations

enum  {
  boolean = 0x01 , integer = 0x02 , bit_string = 0x03 , octet_string = 0x04 ,
  object_identifier = 0x06 , utf8_string = 0x0c , printable_string = 0x13 , ia5_string = 0x16 ,
  utc_time = 0x17 , generalized_time = 0x18 , sequence = 0x30 , set = 0x31
}

Functions

template<typename visit_t>
bool each (const tlv &constructed, visit_t visit) noexcept
 the elements of a constructed element's content, in turn: visit(tlv) returns false to stop; false when the content is malformed
size_t oid (const char *dotted, uint8_t *out, size_t size) noexcept
 a dotted object identifier's content octets ("1.3.6.1.4.1.66825.1.1"): the length encoded, 0 when malformed or not fitting
bool read (const uint8_t *bytes, size_t size, tlv &tlv) noexcept
 the element at bytes[0..size): false past the end or malformed
template<typename visit_t>
bool strings (const uint8_t *bytes, size_t size, visit_t visit) noexcept
 the strings of a value: a single UTF8String/PrintableString/IA5String, or a SEQUENCE OF such - visit(chars, length) returns false to stop
int64_t time (const tlv &value) noexcept
 UTCTime (YYMMDDHHMMSSZ, 1950-2049) or GeneralizedTime (YYYYMMDDHHMMSSZ) as seconds since 1970-01-01 UTC; 0 when malformed.

Detailed Description

ASN.1 DER, walked in place: what a certificate's fields and a license's private extensions take.

Compiled in user mode and in the kernel alike - no allocation, no exception; every step is bounded by the element's own length, the bytes are untrusted.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
boolean 
integer 
bit_string 
octet_string 
object_identifier 
utf8_string 
printable_string 
ia5_string 
utc_time 
generalized_time 
sequence 
set 

Function Documentation

◆ each()

template<typename visit_t>
bool dx::der::each ( const tlv & constructed,
visit_t visit )
noexcept

the elements of a constructed element's content, in turn: visit(tlv) returns false to stop; false when the content is malformed

Here is the call graph for this function:
Here is the caller graph for this function:

◆ oid()

size_t dx::der::oid ( const char * dotted,
uint8_t * out,
size_t size )
inlinenoexcept

a dotted object identifier's content octets ("1.3.6.1.4.1.66825.1.1"): the length encoded, 0 when malformed or not fitting

Here is the caller graph for this function:

◆ read()

bool dx::der::read ( const uint8_t * bytes,
size_t size,
tlv & tlv )
inlinenoexcept

the element at bytes[0..size): false past the end or malformed

Here is the caller graph for this function:

◆ strings()

template<typename visit_t>
bool dx::der::strings ( const uint8_t * bytes,
size_t size,
visit_t visit )
noexcept

the strings of a value: a single UTF8String/PrintableString/IA5String, or a SEQUENCE OF such - visit(chars, length) returns false to stop

Here is the call graph for this function:
Here is the caller graph for this function:

◆ time()

int64_t dx::der::time ( const tlv & value)
inlinenoexcept

UTCTime (YYMMDDHHMMSSZ, 1950-2049) or GeneralizedTime (YYYYMMDDHHMMSSZ) as seconds since 1970-01-01 UTC; 0 when malformed.

Here is the caller graph for this function:

(c) copyright 2009 dynamic acoustics e.U. generated on

a closed source license may be obtained by requesting a written permission from dynamic acoustics e.U.
however - governmental use generally and military use especially is strictly prohibited though.