dxd - dynax driver framework 3.0.1f223
cross platform open source driver development framework
Loading...
Searching...
No Matches
dx::licensing Namespace Reference

a license: an X.509 certificate the product's root signed, its attributes private extensions More...

Enumerations

enum  type { none , demo , beta , perpetual }

Functions

template<typename satisfied_t>
bool constrained (const uint8_t *value, size_t size, satisfied_t satisfied) noexcept
bool covered (const uint8_t *value, size_t size, const char *vendor, const char *model) noexcept
template<typename satisfied_t>
type evaluate (const uint8_t *bytes, size_t size, const char *subject, const char *vendor, const char *model, const uint8_t *root, size_t roots, int64_t now, crypto::rsa &key, satisfied_t satisfied, bool &forged) noexcept
 the type a candidate certificate stands for against the root: none when it is no certificate, its common name does not start with subject, is not the root's (forged says so: a candidate so named whose signature fails), has no type, does not cover the device (vendor, model), has no constraint or an unsatisfied one (satisfied(name, names, value, values) over the terms), or has expired; a perpetual license never expires, the root's own validity does not matter (it is the anchor by construction). A license is always bound: a certificate without the constraints extension, with an empty list or an empty entry is none.
bool same (const char *a, size_t as, const char *b, size_t bs) noexcept
 the same characters, case insensitive
bool same_mac (const char *a, size_t as, const char *b, size_t bs) noexcept
 the same ethernet address: the hex digits, separators (: -) and case aside
type typed (const uint8_t *value, size_t size) noexcept
 the type a DX_OID_LICENSE_TYPE value names (the name within it, case insensitive), none for any other

Detailed Description

a license: an X.509 certificate the product's root signed, its attributes private extensions

DX_OID_LICENSE_TYPE (UTF8String demo | beta | perpetual), DX_OID_LICENSE_MODELS (SEQUENCE OF UTF8String: the devices covered, "<vendor>/<model>", "<vendor>/\*" or "*", OR'ed) and DX_OID_LICENSE_CONSTRAINTS (SEQUENCE OF UTF8String in disjunctive normal form: entries "NAME=VALUE[&NAME=VALUE].." are OR'ed, the terms of one entry AND'ed); all are required. Beta and demo licenses expire at notAfter, a perpetual one never. The root given is the only trust anchor, the signature is verified here (x509::certificate::signed_by): no chain, no platform.

Enumeration Type Documentation

◆ type

Enumerator
none 
demo 
beta 
perpetual 

Function Documentation

◆ constrained()

template<typename satisfied_t>
bool dx::licensing::constrained ( const uint8_t * value,
size_t size,
satisfied_t satisfied )
noexcept

a DX_OID_LICENSE_CONSTRAINTS value is satisfied when one entry's terms all are: satisfied(name, name length, value, value length) decides a term; an absent or empty list is not satisfied - every license is bound

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

◆ covered()

bool dx::licensing::covered ( const uint8_t * value,
size_t size,
const char * vendor,
const char * model )
inlinenoexcept

a DX_OID_LICENSE_MODELS value names the device: an entry "<vendor>/<model>", "<vendor>/*" or "*", compared exactly; an absent or empty list covers nothing

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

◆ evaluate()

template<typename satisfied_t>
type dx::licensing::evaluate ( const uint8_t * bytes,
size_t size,
const char * subject,
const char * vendor,
const char * model,
const uint8_t * root,
size_t roots,
int64_t now,
crypto::rsa & key,
satisfied_t satisfied,
bool & forged )
noexcept

the type a candidate certificate stands for against the root: none when it is no certificate, its common name does not start with subject, is not the root's (forged says so: a candidate so named whose signature fails), has no type, does not cover the device (vendor, model), has no constraint or an unsatisfied one (satisfied(name, names, value, values) over the terms), or has expired; a perpetual license never expires, the root's own validity does not matter (it is the anchor by construction). A license is always bound: a certificate without the constraints extension, with an empty list or an empty entry is none.

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

◆ same()

bool dx::licensing::same ( const char * a,
size_t as,
const char * b,
size_t bs )
inlinenoexcept

the same characters, case insensitive

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

◆ same_mac()

bool dx::licensing::same_mac ( const char * a,
size_t as,
const char * b,
size_t bs )
inlinenoexcept

the same ethernet address: the hex digits, separators (: -) and case aside

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

◆ typed()

type dx::licensing::typed ( const uint8_t * value,
size_t size )
inlinenoexcept

the type a DX_OID_LICENSE_TYPE value names (the name within it, case insensitive), none for any other

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