6 #ifndef _INC_cKeyBase_H
7 #define _INC_cKeyBase_H
12 #include "../Hash/cHashCode.h"
71 static const int k_MAX_VALUES = 2;
#define GRAYLIB_LINK
Definition: GrayLibBase.h:35
INT32 HRESULT
_WIN32 style error codes. INT32
Definition: SysTypes.h:465
Definition: cASNReader.h:22
Definition: cASNWriterRev.h:22
Definition: cKeyBase.h:56
virtual int GetKeyValues(cValue *items) const =0
Interface with the debug module. get debug values.
virtual size_t get_KeySize() const =0
Get key size in bytes.
virtual HRESULT CheckPublicPrivatePair(const cKeyBase *pKeyPrivate) const =0
Check public-private key pair.
VALTYPE_TYPE
Definition: cKeyBase.h:64
virtual HRESULT ReadPrivateKey(cASNReader &r, cASNBuf *pAlgParams=nullptr)=0
Read not encrypted. (already decrypted)
virtual void SetZeroKey()=0
Secure zero the key.
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 ??
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 ??
virtual HRESULT WritePrivateKey(cASNWriterRev &w) const =0
Write not encrypted. (may be encrypted/secured later)
virtual HRESULT ReadPublicKey(cASNReader &r, cASNBuf *pAlgParams=nullptr)=0
virtual HRESULT WritePublicKey(cASNWriterRev &w) const =0
virtual ~cKeyBase()
Definition: cKeyBase.h:82
SSL_Key_TYPE
Definition: cKeyBase.h:24
@ SSL_Key_ECDSA
SSL_KeyExchange_ECDHE_ECDSA.
Definition: cKeyBase.h:32
@ SSL_Key_RSASSA_PSS
OID_RSASSA_PSS "RSASSA-PSS" used for signing.
Definition: cKeyBase.h:34
@ SSL_Key_ECKEY_DH
OID_EC_ALG_ECDH.
Definition: cKeyBase.h:31
@ SSL_Key_RSA
SSL_KeyExchange_RSA = "PRIVATE KEY" = k_pszPEM_PK.
Definition: cKeyBase.h:29
@ SSL_Key_NONE
Definition: cKeyBase.h:28
@ SSL_Key_ECKEY
SSL_KeyExchange_ECDH_RSA = "EC PRIVATE KEY" = k_pszPEM_EC.
Definition: cKeyBase.h:30
@ SSL_Key_QTY
Definition: cKeyBase.h:36
SSL_Hash_TYPE
Definition: cHashCode.h:23
@ SSL_Hash_NONE
Definition: cHashCode.h:30
Definition: cKeyBase.h:74
const char * m_pszName
Definition: cKeyBase.h:78
const void * m_pValue
e.g. const cBigInt* if VALTYPE_RSA
Definition: cKeyBase.h:79
VALTYPE_TYPE m_eValueType
type of value.
Definition: cKeyBase.h:77
Definition: cKeyBase.h:40
SSL_Key_TYPE m_eKeyType
Internal representation of the Public Key algorithm of the signature algorithm, e....
Definition: cKeyBase.h:46
cKeySigAlg(SSL_Hash_TYPE eHashType=SSL_Hash_NONE, SSL_Key_TYPE eKeyType=SSL_Key_NONE)
Definition: cKeyBase.h:48
SSL_Hash_TYPE m_eHashType
Internal representation of the Hash algorithm of the signature algorithm, e.g. HashType_SHA256.
Definition: cKeyBase.h:45