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

#include <cKeyECDSA.h>

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

Public Member Functions

 cKeyECDSA () noexcept
 
virtual ~cKeyECDSA ()
 
virtual HRESULT MakeSignature (BYTE *pSig, SSL_Hash_TYPE eHashType, const BYTE *pHash, size_t nSizeHash, IRandomNoise *pRandom) const override
 Make signature From Key. Make const ?? More...
 
 UNITTEST_FRIEND (cKeyECDSA)
 
- Public Member Functions inherited from GrayLib::cKeyECPPair
 cKeyECPPair () noexcept
 
virtual ~cKeyECPPair ()
 
virtual size_t get_KeySize () const override
 Get key size in bytes. More...
 
virtual int GetKeyValues (cValue *items) const override
 Interface with the debug module. get debug values. More...
 
virtual void SetZeroKey () override
 Secure zero the key. More...
 
void SetCopyKey (const cKeyECPPair &key)
 
virtual HRESULT CheckPublicPrivatePair (const cKeyBase *pKeyPrivate) const override
 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 override
 Verify Key signature. Make const ?? More...
 
HRESULT GenerateKeys (ECPGroup_TYPE eECPGroupId, IRandomNoise *pRandom)
 
HRESULT WriteECParameters (cASNWriterRev &w) const
 
virtual HRESULT ReadPrivateKey (cASNReader &r, cASNBuf *pAlgParams) override
 Read not encrypted. (already decrypted) More...
 
virtual HRESULT ReadPublicKey (cASNReader &r, cASNBuf *pAlgParams) override
 
virtual HRESULT WritePrivateKey (cASNWriterRev &w) const override
 Write not encrypted. (may be encrypted/secured later) More...
 
virtual HRESULT WritePublicKey (cASNWriterRev &w) const override
 
 UNITTEST_FRIEND (cKeyECPPair)
 
- Public Member Functions inherited from GrayLib::cKeyBase
virtual ~cKeyBase ()
 
- 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)
 

Additional Inherited Members

- Public Types inherited from GrayLib::cKeyBase
enum  VALTYPE_TYPE { VALTYPE_NONE = 0 , VALTYPE_RSA = 1 , VALTYPE_ECP = 2 }
 
- Public Attributes inherited from GrayLib::cKeyECPPair
cECPGroup m_grp
 Elliptic curve and base point. More...
 
cBigInteger m_d
 our secret value More...
 
cECPPoint m_Q
 our public value More...
 
- Static Public Attributes inherited from GrayLib::cKeyBase
static const int k_MAX_VALUES = 2
 Maximum number of cValue sent for debugging. More...
 
- Protected Member Functions inherited from GrayLib::cKeyECPPair
HRESULT MakeSignatureSeed (BYTE *pOut, const cBigInteger &d, const BYTE *buf, size_t nSizeBuf) const
 
HRESULT MakeSignatureDer (cASNWriterRev &w, const cBigInteger &r, const cBigInteger &s) const
 
- Static Protected Member Functions inherited from GrayLib::cKeyECPPair
static HRESULT GRAYCALL ReadECParameters (cASNReader &r, OUT cASNBuf &params)
 

Detailed Description

ECDSA context structure. SSL_Key_ECDSA

Constructor & Destructor Documentation

◆ cKeyECDSA()

GrayLib::cKeyECDSA::cKeyECDSA ( )
inlinenoexcept

◆ ~cKeyECDSA()

virtual GrayLib::cKeyECDSA::~cKeyECDSA ( )
inlinevirtual

Member Function Documentation

◆ MakeSignature()

HRESULT GrayLib::cKeyECDSA::MakeSignature ( BYTE *  pSig,
SSL_Hash_TYPE  eHashType,
const BYTE *  pHash,
size_t  hash_len,
IRandomNoise pRandom 
) const
overridevirtual

Make signature From Key. Make const ??

Compute and write signature Use deterministic ECDSA by default if available. cRandomDSA

Note
The "pSig" buffer must be at least as large as twice the size of the curve used, plus 7 (eg. 71 bytes if a 256-bit curve is used). compute ECDSA signature and write it to buffer, serialized as defined in rfc 4492 page 20. (Not thread-safe to use same context in multiple threads)

Reimplemented from GrayLib::cKeyECPPair.

◆ UNITTEST_FRIEND()

GrayLib::cKeyECDSA::UNITTEST_FRIEND ( cKeyECDSA  )

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