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

#include <cX509Common.h>

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

Public Member Functions

 cX509Common () noexcept
 
virtual ~cX509Common ()
 
bool isEmptyX () const noexcept
 
virtual void SetEmptyX ()
 
HRESULT ReadSigAlg (cASNReader &r1, cASNBuf &sig_params)
 
HRESULT GetSigAlgStr (StrBuilder &s) const
 
virtual HRESULT GetDescription (StrBuilder &s, const char *prefix) const =0
 
virtual HRESULT ReadFromDer1 (const BYTE *buf, size_t buflen)=0
 
virtual HRESULT ReadFromDER (const BYTE *buf, size_t buflen)=0
 
virtual HRESULT ReadFromUnk (const BYTE *buf, size_t buflen)=0
 
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 ()
 

Static Public Member Functions

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)
 

Public Attributes

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 int k_MAX_INTERMEDIATE_CA = 8
 

Detailed Description

Constructor & Destructor Documentation

◆ cX509Common()

GrayLib::cX509Common::cX509Common ( )
inlinenoexcept

◆ ~cX509Common()

virtual GrayLib::cX509Common::~cX509Common ( )
inlinevirtual

ASSUME SetEmptyX() called by my override.

Member Function Documentation

◆ GetDescription()

virtual HRESULT GrayLib::cX509Common::GetDescription ( StrBuilder s,
const char *  prefix 
) const
pure virtual

◆ GetSerialStr()

StrLen_t GRAYCALL GrayLib::cX509Common::GetSerialStr ( StrBuilder s,
const cASNBuf serial 
)
static

Get the certificate serial in printable form into StrBuilder; no more than nSizeMax characters will be written.

  • s = Buffer to write to
  • serial = The X509 serial to represent
    Returns
    The amount of data written to the buffer, or -1 in case of an error.

◆ GetSigAlgStr()

HRESULT GrayLib::cX509Common::GetSigAlgStr ( StrBuilder s) const

Helper for writing signature algorithms

◆ isEmptyX()

bool GrayLib::cX509Common::isEmptyX ( ) const
inlinenoexcept

Not loaded?

◆ ReadFromDER()

virtual HRESULT GrayLib::cX509Common::ReadFromDER ( const BYTE *  buf,
size_t  buflen 
)
pure virtual

◆ ReadFromDer1()

virtual HRESULT GrayLib::cX509Common::ReadFromDer1 ( const BYTE *  buf,
size_t  buflen 
)
pure virtual

Implemented in GrayLib::cX509Crl, and GrayLib::cX509Csr.

◆ ReadFromFile()

HRESULT GrayLib::cX509Common::ReadFromFile ( const FILECHAR_t pszFilePath)

Load one or more CRT,CRLs and add them to the chained list or Load a CSR into the structure

◆ ReadFromUnk()

virtual HRESULT GrayLib::cX509Common::ReadFromUnk ( const BYTE *  buf,
size_t  buflen 
)
pure virtual

◆ ReadSigAlg()

HRESULT GrayLib::cX509Common::ReadSigAlg ( cASNReader r1,
cASNBuf sig_params 
)

Get signature algorithm from m_SignOID1 and optional parameters

◆ ReturnError()

HRESULT GrayLib::cX509Common::ReturnError ( HRESULT  hRes)
staticnoexcept

◆ SetEmptyX()

void GrayLib::cX509Common::SetEmptyX ( )
virtual

◆ UNITTEST_FRIEND()

GrayLib::cX509Common::UNITTEST_FRIEND ( cX509Common  )

◆ X509_VerifySet()

static X509_Verify_t GrayLib::cX509Common::X509_VerifySet ( X509_Verify_t  f1,
X509_Verify_t  f2 
)
inlinestaticnoexcept

Add flags to the flags.

Member Data Documentation

◆ k_MAX_INTERMEDIATE_CA

const int GrayLib::cX509Common::k_MAX_INTERMEDIATE_CA = 8
static

◆ m_nVersion

int GrayLib::cX509Common::m_nVersion

1,2,3. 0 = unused. X509_CRT_VERSION_TYPE or CRL version

◆ m_pRSASignOptions

cNewPtr<cKeyRSASignOptions> GrayLib::cX509Common::m_pRSASignOptions

Signature options to be passed to VerifySignatureExt(), e.g. for RSASSA-PSS SSL_Key_RSASSA_PSS.

◆ m_raw

cHeapBlock GrayLib::cX509Common::m_raw

The raw certificate data (ReadFromDer1). cASNBuf pointers can point into this.

◆ m_RawSigned

cASNBuf GrayLib::cX509Common::m_RawSigned

The raw certificate body (in m_raw)(ReadFromDer1). The part that is To Be Signed. Precedes m_nVersion.

◆ m_SigAlg

cKeySigAlg GrayLib::cX509Common::m_SigAlg

How to sign with m_SignOID1.

◆ m_SignBuffer

cASNBuf GrayLib::cX509Common::m_SignBuffer

◆ m_SignOID1

cASNBuf GrayLib::cX509Common::m_SignOID1

Signature algorithm OID, e.g. "sha1RSA" for ReadSigAlg()


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