a license: an X.509 certificate the product's root signed, its attributes private extensions
More...
|
| 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
|
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.
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.