![]() |
Gray C++ Libraries
0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
|
#include <cX509CrtExt.h>
Public Member Functions | |
cX509CrtExt () noexcept | |
bool | HasExtType (X509_EXT_t e) const noexcept |
void | SetEmpty () |
bool | IsKeyUsageValid (X509_KeyUsage_TYPE usage) const |
bool | IsExtKeyUsage (const char *usage_oid, size_t usage_len) const |
HRESULT | GetDescription (StrBuilder &s, const char *prefix) const |
HRESULT | ReadExtensionList (cX509Reader &r) |
void | WriteExtensionList (OUT cASNSets &sets) const |
Static Public Member Functions | |
static HRESULT GRAYCALL | Write_SubjectKeyIdentifier (OUT cASNSets &sets, const cKeyWrap &rSubjectKey) |
static HRESULT GRAYCALL | Write_AuthorityKeyIdentifier (OUT cASNSets &sets, const cKeyWrap &rIssuerKey) |
Public Attributes | |
UINT32 | m_uExtTypes |
Bit mask containing detected and parsed extensions X509_EXT_t. More... | |
bool | m_bCAIsTrue |
X509_EXT_BasicConstraints. if this certificate belongs to a CA. More... | |
int | m_nMaxPathLen |
X509_EXT_BasicConstraints. The maximum path length to the root certificate. Path length is 1 higher than RFC 5280 'meaning', so 1+. More... | |
BYTE | m_nKeyUsage |
X509_EXT_KeyUsage. key usage extension value: X509_KeyUsage_TYPE. More... | |
BYTE | m_nNSCertType |
X509_EXT_NSCertType. Netscape certificate type extension value: X509_NSCERT_TYPE. More... | |
cASNSequence | m_SubjectAltNames |
X509_EXT_SubjectAltNames. list of Subject Alternative Names (SAN) (Only dNSName supported). More... | |
cASNSequence | m_ExtKeyUsage |
X509_EXT_ExtKeyUsage. list of extended key usage OIDs. X509_KeyUsage_TYPE. More... | |
Protected Member Functions | |
HRESULT | Read_BasicConstraints (cASNReader &r) |
HRESULT | Read_KeyUsage (cASNReader &r) |
HRESULT | Read_NSCertType (cASNReader &r) |
HRESULT | Read_ExtKeyUsage (cASNReader &r) |
HRESULT | Read_SubjectAltNames (cASNReader &r) |
HRESULT | ReadExtensionList1 (cASNReader &r) |
HRESULT | Write_BasicConstraints (OUT cASNSets &sets) const |
HRESULT | Write_KeyUsage (OUT cASNSets &sets) const |
HRESULT | Write_NSCertType (OUT cASNSets &sets) const |
HRESULT | Write_ExtKeyUsage (OUT cASNSets &r) const |
HRESULT | Write_SubjectAltNames (OUT cASNSets &r) const |
Static Protected Member Functions | |
static HRESULT | GetStr_NSCertType (StrBuilder &s, BYTE nNSCertType) |
static HRESULT | GetStr_KeyUsage (StrBuilder &s, BYTE nKeyUsage) |
static HRESULT | GetStr_ExtKeyUsage (StrBuilder &s, const cASNSequence &rExtKeyUsage) |
optional extensions for a CRT file. enum as X509_EXT_t
|
inlinenoexcept |
HRESULT GrayLib::cX509CrtExt::GetDescription | ( | StrBuilder & | s, |
const char * | prefix | ||
) | const |
|
staticprotected |
X509_EXT_ExtKeyUsage
|
staticprotected |
X509_EXT_KeyUsage
|
staticprotected |
X509_EXT_NSCertType
|
inlinenoexcept |
bool GrayLib::cX509CrtExt::IsExtKeyUsage | ( | const char * | usage_oid, |
size_t | usage_len | ||
) | const |
Extension is not mandatory, absent means no restriction Check usage of certificate against extentedKeyUsage.
|
inline |
Check usage of certificate against keyUsage extension.
|
protected |
X509_EXT_BasicConstraints BasicConstraints ::= SEQUENCE { cA BOOLEAN DEFAULT FALSE, pathLenConstraint INTEGER (0..MAX) OPTIONAL }
|
protected |
X509_EXT_ExtKeyUsage ExtKeyUsageSyntax ::= SEQUENCE SIZE (1..MAX) OF KeyPurposeId KeyPurposeId ::= OBJECT IDENTIFIER
|
protected |
X509_EXT_KeyUsage
|
protected |
X509_EXT_NSCertType
|
protected |
X509_EXT_SubjectAltNames SubjectAltName ::= GeneralNames
GeneralNames ::= SEQUENCE SIZE (1..MAX) OF GeneralName
GeneralName ::= CHOICE { otherName [0] OtherName, rfc822Name [1] IA5String, dNSName [2] IA5String, x400Address [3] ORAddress, directoryName [4] Name, ediPartyName [5] EDIPartyName, uniformResourceIdentifier [6] IA5String, iPAddress [7] OCTET STRING, registeredID [8] OBJECT IDENTIFIER }
OtherName ::= SEQUENCE { type-id OBJECT IDENTIFIER, value [0] EXPLICIT ANY DEFINED BY type-id }
EDIPartyName ::= SEQUENCE { nameAssigner [0] DirectoryString OPTIONAL, partyName [1] DirectoryString }
HRESULT GrayLib::cX509CrtExt::ReadExtensionList | ( | cX509Reader & | r | ) |
X.509 v3 extensions TODO: Perform all of the basic constraints tests required by the RFC TODO: Set values for undetected extensions to a sane default?
< Optional X.509 v3 extensions. UNUSED.
|
protected |
|
inline |
|
static |
OID_AUTHORITY_KEY_IDENTIFIER
OID_BASIC_CONSTRAINTS = X509_EXT_BasicConstraints
OID_KEY_USAGE = X509_EXT_KeyUsage
OID_NS_CERT_TYPE = X509_EXT_NSCertType
|
static |
OID_SUBJECT_KEY_IDENTIFIER
void GrayLib::cX509CrtExt::WriteExtensionList | ( | OUT cASNSets & | sets | ) | const |
Write all the Extension data here to cASNSets Does not include OID_SUBJECT_KEY_IDENTIFIER or OID_AUTHORITY_KEY_IDENTIFIER
bool GrayLib::cX509CrtExt::m_bCAIsTrue |
X509_EXT_BasicConstraints. if this certificate belongs to a CA.
cASNSequence GrayLib::cX509CrtExt::m_ExtKeyUsage |
X509_EXT_ExtKeyUsage. list of extended key usage OIDs. X509_KeyUsage_TYPE.
BYTE GrayLib::cX509CrtExt::m_nKeyUsage |
X509_EXT_KeyUsage. key usage extension value: X509_KeyUsage_TYPE.
int GrayLib::cX509CrtExt::m_nMaxPathLen |
X509_EXT_BasicConstraints. The maximum path length to the root certificate. Path length is 1 higher than RFC 5280 'meaning', so 1+.
BYTE GrayLib::cX509CrtExt::m_nNSCertType |
X509_EXT_NSCertType. Netscape certificate type extension value: X509_NSCERT_TYPE.
cASNSequence GrayLib::cX509CrtExt::m_SubjectAltNames |
X509_EXT_SubjectAltNames. list of Subject Alternative Names (SAN) (Only dNSName supported).
UINT32 GrayLib::cX509CrtExt::m_uExtTypes |
Bit mask containing detected and parsed extensions X509_EXT_t.