Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
GrayLib::cX509Crl Class Reference

#include <cX509Crl.h>

Inheritance diagram for GrayLib::cX509Crl:
GrayLib::cX509Common Gray::cRefBase IUnknown

Public Member Functions

 cX509Crl ()
 
 ~cX509Crl ()
 
virtual void SetEmptyX () override
 
virtual HRESULT GetDescription (StrBuilder &s, const char *prefix=nullptr) const override
 
bool CheckSignatureParent (const cX509Crt *pCrtParent, X509_Verify_t &rFlags) const
 
bool IsCrtRevoked (const cASNBuf &rSerialNumber) const
 
virtual HRESULT ReadFromDer1 (const BYTE *pBuffer, size_t nSizeBuf) override
 
virtual HRESULT ReadFromDER (const BYTE *pBuffer, size_t nSizeBuf) override
 
virtual HRESULT ReadFromUnk (const BYTE *pBuffer, size_t nSizeBuf) override
 
 UNITTEST_FRIEND (cX509Crl)
 
- Public Member Functions inherited from GrayLib::cX509Common
 cX509Common () noexcept
 
virtual ~cX509Common ()
 
bool isEmptyX () const noexcept
 
HRESULT ReadSigAlg (cASNReader &r1, cASNBuf &sig_params)
 
HRESULT GetSigAlgStr (StrBuilder &s) const
 
HRESULT ReadFromFile (const FILECHAR_t *pszFilePath)
 
 UNITTEST_FRIEND (cX509Common)
 
- Public Member Functions inherited from Gray::cRefBase
 cRefBase (int iRefCount=0) noexcept
 
virtual ~cRefBase ()
 
int get_RefCount () const noexcept
 
HASHCODE_t get_HashCode () const noexcept
 
 STDMETHOD_ (HASHCODE_t, get_HashCodeX)() const noexcept
 
virtual void onFinalRelease ()
 
bool isValidObj () const noexcept
 
 STDMETHOD_ (ULONG, AddRef)(void) override
 
 STDMETHOD_ (ULONG, Release)(void) override
 
STDMETHOD() QueryInterface (const IID &riid, void __RPC_FAR *__RPC_FAR *ppvObject) override
 
void IncRefCount ()
 
void DecRefCount ()
 
bool isStaticConstruct () const noexcept
 
void StaticConstruct ()
 
void StaticDestruct ()
 
bool isDestructing () noexcept
 
void SetDestructing ()
 

Public Attributes

cASNBuf m_issuer_raw
 For faster compares with CRT. More...
 
cASNSets m_issuer
 The parsed issuer data (named information object). More...
 
cTimeUnits m_tThisUpdate
 
cTimeUnits m_tNextUpdate
 OPTIONAL. More...
 
cX509CrlEntry m_entry
 The CRL entries containing the certificate revocation times for this CA. More...
 
cRefPtr< cX509Crlm_pNextCrl
 
- Public Attributes inherited from GrayLib::cX509Common
cHeapBlock m_raw
 The raw certificate data (ReadFromDer1). cASNBuf pointers can point into this. More...
 
cASNBuf m_RawSigned
 The raw certificate body (in m_raw)(ReadFromDer1). The part that is To Be Signed. Precedes m_nVersion. More...
 
int m_nVersion
 1,2,3. 0 = unused. X509_CRT_VERSION_TYPE or CRL version More...
 
cASNBuf m_SignOID1
 Signature algorithm OID, e.g. "sha1RSA" for ReadSigAlg() More...
 
cKeySigAlg m_SigAlg
 How to sign with m_SignOID1. More...
 
cASNBuf m_SignBuffer
 
cNewPtr< cKeyRSASignOptionsm_pRSASignOptions
 Signature options to be passed to VerifySignatureExt(), e.g. for RSASSA-PSS SSL_Key_RSASSA_PSS. More...
 

Static Public Attributes

static const char * k_pszPEM = "X509 CRL"
 
- Static Public Attributes inherited from GrayLib::cX509Common
static const int k_MAX_INTERMEDIATE_CA = 8
 

Protected Member Functions

void SetEmptyX1 ()
 

Additional Inherited Members

- Static Public Member Functions inherited from GrayLib::cX509Common
static HRESULT ReturnError (HRESULT hRes) noexcept
 
static X509_Verify_t X509_VerifySet (X509_Verify_t f1, X509_Verify_t f2) noexcept
 
static StrLen_t GRAYCALL GetSerialStr (StrBuilder &s, const cASNBuf &serial)
 

Detailed Description

"Certificate revocation list" structure. https://en.wikipedia.org/wiki/Certificate_revocation_list Every CRL may have multiple entries. CRL version (1=v1, 2=v2)

Constructor & Destructor Documentation

◆ cX509Crl()

GrayLib::cX509Crl::cX509Crl ( )
inline

◆ ~cX509Crl()

GrayLib::cX509Crl::~cX509Crl ( )
inline

Member Function Documentation

◆ CheckSignatureParent()

bool GrayLib::cX509Crl::CheckSignatureParent ( const cX509Crt pCrtParent,
X509_Verify_t rFlags 
) const

Is this CRL signed by pCrtParent ?

Returns
true = use this CRL.

◆ GetDescription()

HRESULT GrayLib::cX509Crl::GetDescription ( StrBuilder s,
const char *  prefix = nullptr 
) const
overridevirtual

Returns an informational string about the CRL/certificate.

  • s = Buffer to write to
  • prefix = A line prefix
    Returns
    The amount of data written to the buffer, or -1 in case of an error.

Implements GrayLib::cX509Common.

◆ IsCrtRevoked()

bool GrayLib::cX509Crl::IsCrtRevoked ( const cASNBuf rSerialNumber) const

Verify the certificate revocation status

Returns
true if the certificate is revoked

◆ ReadFromDER()

HRESULT GrayLib::cX509Crl::ReadFromDER ( const BYTE *  pBuffer,
size_t  nSizeBuf 
)
overridevirtual

Parse one CRLs in DER format and append it to the chained list Check for valid input

Implements GrayLib::cX509Common.

◆ ReadFromDer1()

HRESULT GrayLib::cX509Crl::ReadFromDer1 ( const BYTE *  pBuffer,
size_t  nSizeBuf 
)
overridevirtual

Parse a DER-encoded CRL and append it to the chained list

  • pBuffer = buffer holding the CRL data in DER format
  • nSizeBuf = size of the buffer
    Returns
    0 if successful, or a specific X509 or PEM error code

– if present, MUST be v2 } OPTIONAL

< Signature algorithm. Must match m_SignOID1.

Implements GrayLib::cX509Common.

◆ ReadFromUnk()

HRESULT GrayLib::cX509Crl::ReadFromUnk ( const BYTE *  pBuffer,
size_t  nSizeBuf 
)
overridevirtual

Parse one or more CRLs and append them to the chained list

Note
Multiple CRLs are accepted only if using PEM format
  • pBuffer = buffer holding the CRL data in PEM or DER format
  • nSizeBuf = size of the buffer
Returns
0 if successful, or a specific X509 or PEM error code

Parse one or more CRLs (from PEM or DER) and add them to the chained list

Implements GrayLib::cX509Common.

◆ SetEmptyX()

void GrayLib::cX509Crl::SetEmptyX ( )
overridevirtual

Reimplemented from GrayLib::cX509Common.

◆ SetEmptyX1()

void GrayLib::cX509Crl::SetEmptyX1 ( )
protected

Unallocate CRL internal data. Ignore m_pNextCrl chain.

◆ UNITTEST_FRIEND()

GrayLib::cX509Crl::UNITTEST_FRIEND ( cX509Crl  )

Member Data Documentation

◆ k_pszPEM

const char * GrayLib::cX509Crl::k_pszPEM = "X509 CRL"
static

◆ m_entry

cX509CrlEntry GrayLib::cX509Crl::m_entry

The CRL entries containing the certificate revocation times for this CA.

◆ m_issuer

cASNSets GrayLib::cX509Crl::m_issuer

The parsed issuer data (named information object).

◆ m_issuer_raw

cASNBuf GrayLib::cX509Crl::m_issuer_raw

For faster compares with CRT.

◆ m_pNextCrl

cRefPtr<cX509Crl> GrayLib::cX509Crl::m_pNextCrl

◆ m_tNextUpdate

cTimeUnits GrayLib::cX509Crl::m_tNextUpdate

OPTIONAL.

◆ m_tThisUpdate

cTimeUnits GrayLib::cX509Crl::m_tThisUpdate

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