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

dx::license's platform part on the Security framework: the keychain's candidates, the chain of trust More...

#include <dx_platform_license.h>

Inheritance diagram for dx::platform::license:
Collaboration diagram for dx::platform::license:

Public Member Functions

::CFStringRef cn () const
::CFIndex count () const noexcept
const uint8_tdata () const noexcept
 the DER bytes
 dx_catchall_rethrow () const reference &retain() const noexcept
 dx_catchall_rethrow () virtual ~certificate()
::CFArrayRef emails () const
void free () noexcept
CFTypeID id () noexcept
CFTypeID id () noexcept
CFTypeID id () noexcept
CFTypeID id () noexcept
CFTypeID id () noexcept
CFTypeID id () noexcept
CFTypeID id () noexcept
CFTypeID id () noexcept
CFTypeID id () noexcept
CFTypeID id () noexcept
CFTypeID id () noexcept
CFTypeID id () noexcept
CFTypeID id () noexcept
CFTypeID id () noexcept
CFTypeID id () noexcept
CFTypeID id () noexcept
CFTypeID id () noexcept
CFTypeID id () noexcept
CFTypeID id () noexcept
CFTypeID id () noexcept
CFTypeID id () noexcept
CFTypeID id () noexcept
referenceinitialize (::SecCertificateRef cf_object, bool retain=true) try
::CFDataRef issuers () const noexcept
 The issuer is a sequence in the format used by SecItemCopyMatching. The content returned is a DER-encoded X.509 distinguished name. For a display version of the issuer, call SecCertificateCopyValues. The caller must CFRelease the value returned.
std::string name (::DWORD type=CERT_NAME_SIMPLE_DISPLAY_TYPE, ::DWORD flags=0) const
 a name of the certificate (CertGetNameString), the subject's simple display name by default
 operator::CFDataRef () const noexcept
 operator::CFDictionaryRef () const noexcept
 operator::CFTypeID () const noexcept
 operator::PCCERT_CONTEXT () const noexcept
 operator::SecCertificateRef () const noexcept
 operator::SecKeyRef () const noexcept
 Retrieves the public key for a given certificate.
::CFTypeRef operator[] (::CFArrayRef array) const noexcept
::CFTypeRef operator[] (::CFStringRef oid) const try
referencerelease () noexcept
::CFDataRef serial () const noexcept
 Return the content of a DER-encoded integer (without the tag and length fields) for this certificate's serial number. The caller must CFRelease the value returned.
size_t size () const noexcept
::CFDataRef subjects () const noexcept
 The subject is a sequence in the format used by SecItemCopyMatching. The content returned is a DER-encoded X.509 distinguished name. For a display version of the subject, call SecCertificateCopyValues. The caller must CFRelease the value returned.
::CFStringRef summary () const noexcept
::CFDateRef valid_after () const noexcept
 Returns the absolute time at which the given certificate becomes valid, or NULL if this value could not be obtained. The caller must CFRelease the value returned.
::CFDateRef valid_before () const noexcept
 Returns the absolute time at which the given certificate becomes valid, or NULL if this value could not be obtained. The caller must CFRelease the value returned.

Protected Types

typedef sec::certificate candidate
typedef crypt::certificate candidate

Protected Member Functions

void keep (candidate &certificate)
void keep (candidate &certificate) noexcept

Static Protected Member Functions

template<typename visit_t>
static bool each (const char *subject, visit_t visit)
 every keychain certificate whose subject starts with the product's name, until visit(candidate, DER bytes, size) returns false
template<typename visit_t>
static bool each (const char *subject, visit_t visit)
 every certificate of the stores whose subject names the product, until visit(candidate, DER bytes, size) returns false
static void missing ()
 no candidate stood: the keychain holds no license
static void missing () noexcept
 no candidate stood: the stores hold no license
static int64_t now () noexcept
static int64_t now () noexcept
static bool trusted (candidate &certificate, const uint8_t *root, size_t size, int64_t at)
 the candidate chains to the root, the only trust anchor, at the given time (seconds since 1970; 0: now)
static bool trusted (candidate &certificate, const uint8_t *root, size_t size, int64_t at)
 the candidate chains to the root, the only trust anchor, at the given time (seconds since 1970; 0: now)

Protected Attributes

::SecCertificateRef cf_object
::PCCERT_CONTEXT context {}

Detailed Description

dx::license's platform part on the Security framework: the keychain's candidates, the chain of trust

dx::license's platform part on CryptoAPI: the candidates of the system certificate stores, the chain of trust

A candidate is a keychain certificate whose subject starts with the product's name. The chain is evaluated with the given root as its only anchor (the keychain trust settings are ignored), at the given date or now; a candidate that does not chain is the enforcement's case (dx_pass_sec_fatal).

The license certificate sits in the Personal store of the current user (a double click on the .crt installs it there) or of the machine (the installer's place, the one a service sees); a candidate names the product in its subject. The chain is evaluated with the given root as its only anchor (an exclusive root store), at the given time or now.

Member Typedef Documentation

◆ candidate [1/2]

◆ candidate [2/2]

Member Function Documentation

◆ cn()

::CFStringRef sec::certificate::cn ( ) const
inlineinherited
Here is the call graph for this function:
Here is the caller graph for this function:

◆ count()

::CFIndex cf::reference< ::SecCertificateRef >::count ( ) const
inlinenoexceptinherited
Here is the caller graph for this function:

◆ data()

const uint8_t * crypt::certificate::data ( ) const
inlinenoexceptinherited

the DER bytes

Here is the caller graph for this function:

◆ dx_catchall_rethrow() [1/2]

cf::reference< ::SecCertificateRef >::dx_catchall_rethrow ( ) const &
inlinenoexceptinherited

◆ dx_catchall_rethrow() [2/2]

crypt::certificate::dx_catchall_rethrow ( )
inlineinherited

◆ each() [1/2]

template<typename visit_t>
bool dx::platform::license::each ( const char * subject,
visit_t visit )
inlinestaticprotected

every keychain certificate whose subject starts with the product's name, until visit(candidate, DER bytes, size) returns false

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

◆ each() [2/2]

template<typename visit_t>
bool dx::platform::license::each ( const char * subject,
visit_t visit )
inlinestaticprotected

every certificate of the stores whose subject names the product, until visit(candidate, DER bytes, size) returns false

Here is the call graph for this function:

◆ emails()

::CFArrayRef sec::certificate::emails ( ) const
inlineinherited
Here is the call graph for this function:
Here is the caller graph for this function:

◆ free()

void crypt::certificate::free ( )
inlinenoexceptinherited
Here is the caller graph for this function:

◆ id() [1/22]

CFTypeID cf::reference<::CFMutableArrayRef >::id ( )
inlinenoexceptinherited

◆ id() [2/22]

CFTypeID cf::reference<::CFArrayRef >::id ( )
inlinenoexceptinherited

◆ id() [3/22]

CFTypeID cf::reference<::CFBundleRef >::id ( )
inlinenoexceptinherited

◆ id() [4/22]

CFTypeID cf::reference<::CFDataRef >::id ( )
inlinenoexceptinherited

◆ id() [5/22]

CFTypeID cf::reference<::CFMutableDictionaryRef >::id ( )
inlinenoexceptinherited

◆ id() [6/22]

CFTypeID cf::reference<::CFDictionaryRef >::id ( )
inlinenoexceptinherited

◆ id() [7/22]

CFTypeID cf::reference<::CFErrorRef >::id ( )
inlinenoexceptinherited

◆ id() [8/22]

CFTypeID cf::reference<::CFBooleanRef >::id ( )
inlinenoexceptinherited

◆ id() [9/22]

CFTypeID cf::reference<::CFNumberRef >::id ( )
inlinenoexceptinherited

◆ id() [10/22]

CFTypeID cf::reference<::CFRunLoopObserverRef >::id ( )
inlinenoexceptinherited

◆ id() [11/22]

CFTypeID cf::reference<::CFRunLoopSourceRef >::id ( )
inlinenoexceptinherited

◆ id() [12/22]

CFTypeID cf::reference<::CFRunLoopRef >::id ( )
inlinenoexceptinherited

◆ id() [13/22]

CFTypeID cf::reference<::CFReadStreamRef >::id ( )
inlinenoexceptinherited

◆ id() [14/22]

CFTypeID cf::reference<::CFMutableStringRef >::id ( )
inlinenoexceptinherited

◆ id() [15/22]

CFTypeID cf::reference<::CFStringRef >::id ( )
inlinenoexceptinherited

◆ id() [16/22]

CFTypeID cf::reference<::CFURLRef >::id ( )
inlinenoexceptinherited

◆ id() [17/22]

CFTypeID cf::reference<::CFUUIDRef >::id ( )
inlinenoexceptinherited

◆ id() [18/22]

CFTypeID cf::reference<::SCPreferencesRef >::id ( )
inlinenoexceptinherited

◆ id() [19/22]

CFTypeID cf::reference<::SecTrustRef >::id ( )
inlinenoexceptinherited

◆ id() [20/22]

CFTypeID cf::reference<::SecCertificateRef >::id ( )
inlinenoexceptinherited

◆ id() [21/22]

CFTypeID cf::reference<::SecStaticCodeRef >::id ( )
inlinenoexceptinherited

◆ id() [22/22]

CFTypeID cf::reference<::SecCodeRef >::id ( )
inlinenoexceptinherited

◆ initialize()

reference & cf::reference< ::SecCertificateRef >::initialize ( ::SecCertificateRef cf_object,
bool retain = true )
inlineinherited

◆ issuers()

::CFDataRef sec::certificate::issuers ( ) const
inlinenoexceptinherited

The issuer is a sequence in the format used by SecItemCopyMatching. The content returned is a DER-encoded X.509 distinguished name. For a display version of the issuer, call SecCertificateCopyValues. The caller must CFRelease the value returned.

Here is the call graph for this function:

◆ keep() [1/2]

void dx::platform::license::keep ( candidate & certificate)
inlineprotected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ keep() [2/2]

void dx::platform::license::keep ( candidate & certificate)
inlineprotectednoexcept
Here is the call graph for this function:

◆ missing() [1/2]

void dx::platform::license::missing ( )
inlinestaticprotected

no candidate stood: the keychain holds no license

Here is the caller graph for this function:

◆ missing() [2/2]

void dx::platform::license::missing ( )
inlinestaticprotectednoexcept

no candidate stood: the stores hold no license

◆ name()

std::string crypt::certificate::name ( ::DWORD type = CERT_NAME_SIMPLE_DISPLAY_TYPE,
::DWORD flags = 0 ) const
inlineinherited

a name of the certificate (CertGetNameString), the subject's simple display name by default

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

◆ now() [1/2]

int64_t dx::platform::license::now ( )
inlinestaticprotectednoexcept
Here is the caller graph for this function:

◆ now() [2/2]

int64_t dx::platform::license::now ( )
inlinestaticprotectednoexcept

◆ operator::CFDataRef()

sec::certificate::operator::CFDataRef ( ) const
inlinenoexceptinherited
Here is the caller graph for this function:

◆ operator::CFDictionaryRef()

sec::certificate::operator::CFDictionaryRef ( ) const
inlinenoexceptinherited

◆ operator::CFTypeID()

cf::reference< ::SecCertificateRef >::operator::CFTypeID ( ) const
inlineexplicitnoexceptinherited

◆ operator::PCCERT_CONTEXT()

crypt::certificate::operator::PCCERT_CONTEXT ( ) const
inlinenoexceptinherited
Here is the caller graph for this function:

◆ operator::SecCertificateRef()

cf::reference< ::SecCertificateRef >::operator ::SecCertificateRef ( ) const
inlinenoexceptinherited
Here is the caller graph for this function:

◆ operator::SecKeyRef()

sec::certificate::operator::SecKeyRef ( ) const
inlinenoexceptinherited

Retrieves the public key for a given certificate.

◆ operator[]() [1/2]

::CFTypeRef sec::certificate::operator[] ( ::CFArrayRef array) const
inlinenoexceptinherited

◆ operator[]() [2/2]

::CFTypeRef sec::certificate::operator[] ( ::CFStringRef oid) const
inlineinherited

◆ release()

reference & cf::reference< ::SecCertificateRef >::release ( )
inlinenoexceptinherited

◆ serial()

::CFDataRef sec::certificate::serial ( ) const
inlinenoexceptinherited

Return the content of a DER-encoded integer (without the tag and length fields) for this certificate's serial number. The caller must CFRelease the value returned.

Here is the call graph for this function:

◆ size()

size_t crypt::certificate::size ( ) const
inlinenoexceptinherited
Here is the caller graph for this function:

◆ subjects()

::CFDataRef sec::certificate::subjects ( ) const
inlinenoexceptinherited

The subject is a sequence in the format used by SecItemCopyMatching. The content returned is a DER-encoded X.509 distinguished name. For a display version of the subject, call SecCertificateCopyValues. The caller must CFRelease the value returned.

Here is the call graph for this function:

◆ summary()

::CFStringRef sec::certificate::summary ( ) const
inlinenoexceptinherited

◆ trusted() [1/2]

bool dx::platform::license::trusted ( candidate & certificate,
const uint8_t * root,
size_t size,
int64_t at )
inlinestaticprotected

the candidate chains to the root, the only trust anchor, at the given time (seconds since 1970; 0: now)

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

◆ trusted() [2/2]

bool dx::platform::license::trusted ( candidate & certificate,
const uint8_t * root,
size_t size,
int64_t at )
inlinestaticprotected

the candidate chains to the root, the only trust anchor, at the given time (seconds since 1970; 0: now)

Todo
DX_SEC_ENFORCEMENT on Windows: a certificate naming the product that does not chain to the root
Here is the call graph for this function:

◆ valid_after()

::CFDateRef sec::certificate::valid_after ( ) const
inlinenoexceptinherited

Returns the absolute time at which the given certificate becomes valid, or NULL if this value could not be obtained. The caller must CFRelease the value returned.

◆ valid_before()

::CFDateRef sec::certificate::valid_before ( ) const
inlinenoexceptinherited

Returns the absolute time at which the given certificate becomes valid, or NULL if this value could not be obtained. The caller must CFRelease the value returned.

Member Data Documentation

◆ cf_object

::SecCertificateRef cf::reference< ::SecCertificateRef >::cf_object
protectedinherited

◆ context

::PCCERT_CONTEXT crypt::certificate::context {}
protectedinherited

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

(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.