dxd - dynax driver framework 3.0.1d223
cross platform open source driver development framework
Loading...
Searching...
No Matches
dx_license.h File Reference
#include "dx_crypto_rsa.h"
#include "dx_version.h"
#include "dx_platform_license.h"
#include <ostream>
Include dependency graph for dx_license.h:

Classes

struct  dx::der::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...
class  dx::license
 the first certificate of the platform's store naming the product that the root signed, whose constraints this machine and device satisfy and that, unless perpetual, has not expired; kernel and user mode alike over the platform part (dx_platform_license.h: the store's candidates and their DER, the time, the machine's serial number and ethernet addresses, what to keep and the missing/forged hooks) More...
struct  dx::x509::certificate

Namespaces

namespace  dx
 dynax driver framework interface namespace
namespace  dx::der
 ASN.1 DER, walked in place: what a certificate's fields and a license's private extensions take.
namespace  dx::licensing
 a license: an X.509 certificate the product's root signed, its attributes private extensions
namespace  dx::x509
 the fields of an X.509 certificate a license check reads, off its DER: kernel and user mode alike

Enumerations

enum  {
  dx::der::boolean = 0x01 , dx::der::integer = 0x02 , dx::der::bit_string = 0x03 , dx::der::octet_string = 0x04 ,
  dx::der::object_identifier = 0x06 , dx::der::utf8_string = 0x0c , dx::der::printable_string = 0x13 , dx::der::ia5_string = 0x16 ,
  dx::der::utc_time = 0x17 , dx::der::generalized_time = 0x18 , dx::der::sequence = 0x30 , dx::der::set = 0x31
}
enum  dx::licensing::type { dx::licensing::none , dx::licensing::demo , dx::licensing::beta , dx::licensing::perpetual }

Functions

template<typename satisfied_t>
bool dx::licensing::constrained (const uint8_t *value, size_t size, satisfied_t satisfied) noexcept
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
template<typename satisfied_t>
type dx::licensing::evaluate (const uint8_t *bytes, size_t size, const char *subject, 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, names another product (its common name does not start with subject), is not the root's (forged says so: a candidate naming the product whose signature fails), has no type, 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.
size_t dx::der::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
std::ostream & operator<< (std::ostream &os, const dx::license &license)
 the type and the platform's view of the certificate
bool dx::der::read (const uint8_t *bytes, size_t size, tlv &tlv) noexcept
 the element at bytes[0..size): false past the end or malformed
bool dx::licensing::same (const char *a, size_t as, const char *b, size_t bs) noexcept
 the same characters, case insensitive
bool dx::licensing::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
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
int64_t dx::der::time (const tlv &value) noexcept
 UTCTime (YYMMDDHHMMSSZ, 1950-2049) or GeneralizedTime (YYYYMMDDHHMMSSZ) as seconds since 1970-01-01 UTC; 0 when malformed.
type dx::licensing::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

Function Documentation

◆ operator<<()

std::ostream & operator<< ( std::ostream & os,
const dx::license & license )
inline

the type and the platform's view of the certificate

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.