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

#include <cKeyBase.h>

Inheritance diagram for GrayLib::cKeyBase:
Gray::cRefBase Gray::CObject IUnknown GrayLib::cKeyECPPair GrayLib::cKeyRSA GrayLib::cKeyECDSA

Classes

struct  cValue
 

Public Types

enum  VALTYPE_TYPE { VALTYPE_NONE = 0 , VALTYPE_RSA = 1 , VALTYPE_ECP = 2 }
 

Public Member Functions

virtual ~cKeyBase ()
 
virtual size_t get_KeySize () const =0
 Get key size in bytes. More...
 
virtual int GetKeyValues (cValue *items) const =0
 Interface with the debug module. get debug values. More...
 
virtual HRESULT CheckPublicPrivatePair (const cKeyBase *pKeyPrivate) const =0
 Check public-private key pair. More...
 
virtual HRESULT VerifySignature (SSL_Hash_TYPE eHashType, const BYTE *pHash, size_t nSizeHash, const BYTE *pSig, size_t nSizeSig) const =0
 Verify Key signature. Make const ?? More...
 
virtual HRESULT MakeSignature (BYTE *pSig, SSL_Hash_TYPE eHashType, const BYTE *pHash, size_t hash_len, IRandomNoise *pRandom) const =0
 Make signature From Key. Make const ?? More...
 
virtual void SetZeroKey ()=0
 Secure zero the key. More...
 
virtual HRESULT ReadPublicKey (cASNReader &r, cASNBuf *pAlgParams=nullptr)=0
 
virtual HRESULT WritePublicKey (cASNWriterRev &w) const =0
 
virtual HRESULT ReadPrivateKey (cASNReader &r, cASNBuf *pAlgParams=nullptr)=0
 Read not encrypted. (already decrypted) More...
 
virtual HRESULT WritePrivateKey (cASNWriterRev &w) const =0
 Write not encrypted. (may be encrypted/secured later) More...
 
- 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 Member Functions inherited from Gray::CObject
virtual ~CObject ()
 
virtual bool isValidCheck () const noexcept
 < memory allocation and structure definitions are valid. More...
 
virtual void AssertValid () const
 < memory allocation and structure definitions are valid. More...
 
virtual void Serialize (cArchive &a)
 

Static Public Attributes

static const int k_MAX_VALUES = 2
 Maximum number of cValue sent for debugging. More...
 

Detailed Description

All public key providers must support these functions for SSL. abstract base Overridden by: cKeyECDSA, cKeyECPPair, cKeyRSA Defined by cKeyTypeDef

Member Enumeration Documentation

◆ VALTYPE_TYPE

Enumerator
VALTYPE_NONE 

Types for interfacing with the debug module. like SSL_SIG_TYPE.

VALTYPE_RSA 

cBigUnsigned* for cKeyRSA

VALTYPE_ECP 

cECPPoint* for cKeyECPPair and derived (cKeyECDSA).

Constructor & Destructor Documentation

◆ ~cKeyBase()

virtual GrayLib::cKeyBase::~cKeyBase ( )
inlinevirtual

allow delete virtual base to work.

Member Function Documentation

◆ CheckPublicPrivatePair()

virtual HRESULT GrayLib::cKeyBase::CheckPublicPrivatePair ( const cKeyBase pKeyPrivate) const
pure virtual

Check public-private key pair.

Implemented in GrayLib::cKeyRSA, and GrayLib::cKeyECPPair.

◆ get_KeySize()

virtual size_t GrayLib::cKeyBase::get_KeySize ( ) const
pure virtual

Get key size in bytes.

Implemented in GrayLib::cKeyRSA, and GrayLib::cKeyECPPair.

◆ GetKeyValues()

virtual int GrayLib::cKeyBase::GetKeyValues ( cValue items) const
pure virtual

Interface with the debug module. get debug values.

Implemented in GrayLib::cKeyRSA, and GrayLib::cKeyECPPair.

◆ MakeSignature()

virtual HRESULT GrayLib::cKeyBase::MakeSignature ( BYTE *  pSig,
SSL_Hash_TYPE  eHashType,
const BYTE *  pHash,
size_t  hash_len,
IRandomNoise pRandom 
) const
pure virtual

Make signature From Key. Make const ??

Implemented in GrayLib::cKeyRSA, GrayLib::cKeyECPPair, and GrayLib::cKeyECDSA.

◆ ReadPrivateKey()

virtual HRESULT GrayLib::cKeyBase::ReadPrivateKey ( cASNReader r,
cASNBuf pAlgParams = nullptr 
)
pure virtual

Read not encrypted. (already decrypted)

Implemented in GrayLib::cKeyRSA, and GrayLib::cKeyECPPair.

◆ ReadPublicKey()

virtual HRESULT GrayLib::cKeyBase::ReadPublicKey ( cASNReader r,
cASNBuf pAlgParams = nullptr 
)
pure virtual

Implemented in GrayLib::cKeyRSA, and GrayLib::cKeyECPPair.

◆ SetZeroKey()

virtual void GrayLib::cKeyBase::SetZeroKey ( )
pure virtual

Secure zero the key.

Implemented in GrayLib::cKeyRSA, and GrayLib::cKeyECPPair.

◆ VerifySignature()

virtual HRESULT GrayLib::cKeyBase::VerifySignature ( SSL_Hash_TYPE  eHashType,
const BYTE *  pHash,
size_t  nSizeHash,
const BYTE *  pSig,
size_t  nSizeSig 
) const
pure virtual

Verify Key signature. Make const ??

Implemented in GrayLib::cKeyRSA, and GrayLib::cKeyECPPair.

◆ WritePrivateKey()

virtual HRESULT GrayLib::cKeyBase::WritePrivateKey ( cASNWriterRev w) const
pure virtual

Write not encrypted. (may be encrypted/secured later)

Implemented in GrayLib::cKeyRSA, and GrayLib::cKeyECPPair.

◆ WritePublicKey()

virtual HRESULT GrayLib::cKeyBase::WritePublicKey ( cASNWriterRev w) const
pure virtual

Implemented in GrayLib::cKeyRSA, and GrayLib::cKeyECPPair.

Member Data Documentation

◆ k_MAX_VALUES

const int GrayLib::cKeyBase::k_MAX_VALUES = 2
static

Maximum number of cValue sent for debugging.


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