13 #ifndef P6CRYPTOKEY_H__
14 #define P6CRYPTOKEY_H__ 1
331 #define IF_p6ICryptoKeyInit {0x7AAB1F32,0x075B,0x4B8D,{0xB0,0xE6,0xE4,0xCE,0x82,0x28,0x82,0xB7}}
577 #define IF_p6ICryptoKeyGetMeta {0x8f3c646f,0x98b2,0x493d,{0x8c,0x10,0xe,0x71,0x9,0x20,0x64,0xff}}
727 #define IF_p6ICryptoKeySetMeta {0xcb3dca8c,0xfa0e,0x41eb,{0x85,0x38,0xfc,0x3a,0x7,0xd1,0xa3,0x8a}}
749 static const P6CRYPTOKEYMASK P6CKM_NONE = 0x00000000;
750 static const P6CRYPTOKEYMASK P6CKM_CLASS = 0x00000001;
751 static const P6CRYPTOKEYMASK P6CKM_TYPE = 0x00000002;
752 static const P6CRYPTOKEYMASK P6CKM_SIZE = 0x00000004;
753 static const P6CRYPTOKEYMASK P6CKM_GUID = 0x00000008;
754 static const P6CRYPTOKEYMASK P6CKM_VERSION = 0x00000010;
1135 #define IF_p6ICryptoKey {0xA8E297EE,0x8F07,0x4D33,{0xAD,0x7F,0xCC,0x64,0x2B,0x52,0xE7,0x65}}
1138 #define COMP_p6CryptoKey {0xD797AD3A,0x1CD8,0x4A78,{0xAF,0x7E,0x3E,0xE0,0x3B,0x1A,0xD8,0x97}}
virtual P6R::P6ERR loadPKCS8Key(const P6VOID *pBuffer, P6UINT32 cBuffer, P6UINT32 keySize)=0
Load the PKCS#8 encoded private key (either in PEM format or binary ASN.1 format).
const P6CRYPTOKEYFLAGS P6CKF_FORCENEWIV
virtual P6R::P6ERR initialize(P6CRYPTOKEYFLAGS flags, p6IRandom *pRandom)=0
Place the object in a state to load one or more crypto keys.
Cryptography component definitions.
This interface provides key metadata infrormation and key access.
P6UINT32 P6CRYPTOKEYFLAGS
P6CRYPTOKEYFLAGS.
virtual P6R::P6ERR loadRawPublicDSAKey(const P6UCHAR *pP, P6UINT32 pLength, const P6UCHAR *pQ, P6UINT32 qLength, const P6UCHAR *pG, P6UINT32 gLength, const P6UCHAR *pY, P6UINT32 yLength)=0
This method loads the standard parts of a DSA (DSS) public key from a set of buffers.
virtual P6R::P6ERR validateKey(P6CRYPTOKEYINFO *pKeyInfo)=0
This method is used to validate the keys metadata against the provided parameter. ...
Used to initialize and load a crypto key from a file or buffers.
virtual P6R::P6ERR getDSAPublicKey(P6BSTR *pP, P6BSTR *pQ, P6BSTR *pG, P6BSTR *pY)=0
This method retrieves the standard parts of a DSA (DSS) public key.
virtual P6R::P6ERR serializeToFile(const P6WCHAR *pFile)=0
Write the key in this component to the file defined in the parameter.
virtual P6R::P6ERR getKeyPKCS1(P6UCHAR *pBuffer, P6UINT32 cBuffer, P6BOOL wantPEM, P6UINT32 *pWritten)=0
This method retrieves a RSA private or public key in the PKCS#1 format (unencrypted format)...
P6CRYPTOKEYCLASS
Used to categorize keys:
virtual P6R::P6ERR getInfo(P6CRYPTOKEYCLASS *pClass, P6CRYPTOKEYTYPE *pType, P6UUID *pGuid, P6INT32 *pKeySize, P6INT32 *pVersion)=0
This method returns the key's metadata.
virtual P6R::P6ERR getKeyPKCS8(P6UCHAR *pBuffer, P6UINT32 cBuffer, P6BOOL wantPEM, P6UINT32 *pWritten)=0
This method retrieves a private key in the PKCS#8 format (unencrypted format).
P6CRYPTOKEYTYPE
Used to categorize keys:
virtual P6R::P6ERR serializeToBuffer(P6VOID *pBuffer, P6UINT32 cBuffer, P6UINT32 *pcBytesWritten)=0
Write the key in this component to the provided buffer.
virtual P6R::P6ERR isEquals(p6ICryptoKey *pOtherKey, P6BOOL *pbEqual)=0
Is the key in the 'pOtherKey' parameter the same as the key stored in this component.
virtual P6R::P6ERR getSymetricKey(P6UCHAR *pBuffer, P6UINT32 cBuffer, P6UINT32 *pWritten)=0
This method retrieves the raw bits of a symetric key (i.e., no metadata and not base64 encoded – see ...
virtual P6R::P6ERR getDSAPrivateKey(P6BSTR *pP, P6BSTR *pQ, P6BSTR *pG, P6BSTR *pX)=0
This method retrieves the standard parts of a DSA (DSS) private key.
[p6]COM Cryptographic Random Number Generator.
virtual P6R::P6ERR loadPublicPKCS1Key(const P6VOID *pBuffer, P6UINT32 cBuffer, P6UINT32 keySize)=0
Load the PKCS#1 encoded public key (either in PEM format or binary ASN.1 format). ...
P6CRYPTOCIPHER
Cipher Type.
wchar_t P6WCHAR
Wide character type see p6i18n.h.
The base interface all [p6]COM components must derive from and implement.
virtual P6R::P6ERR loadPrivatePKCS1Key(const P6VOID *pBuffer, P6UINT32 cBuffer, P6UINT32 keySize)=0
Load the PKCS#1 encoded private key (either in PEM format or binary ASN.1 format).
virtual P6R::P6ERR getRSAPublicKey(P6BSTR *pN, P6BSTR *pE)=0
This method retrieves the standard parts of a RSA public key.
Provides a cryptographically strong random number generator.
const P6CRYPTOKEYFLAGS P6CKF_NONE
P6CRYPTOKEYSTATE
The current state of the key as defined in: NIST DRAFT Special Publication 800-130, A Framework for Designing Cryptographic Key Management Systems, June 15, 2010.
A universally unique indentifier (UUID).
virtual P6R::P6ERR loadKeyFromBuffer(const P6VOID *pBuffer, P6UINT32 cBuffer)=0
This function does the same operation as the loadKey() method except that the key data resides in a b...
virtual P6R::P6ERR loadRawPrivateDSAKey(const P6UCHAR *pP, P6UINT32 pLength, const P6UCHAR *pQ, P6UINT32 qLength, const P6UCHAR *pG, P6UINT32 gLength, const P6UCHAR *pX, P6UINT32 xLength)=0
This method loads the standard parts of a DSA (DSS) private key from a set of buffers.
virtual P6R::P6ERR loadKey(const P6WCHAR *pszFilename)=0
This function reads the crypto key from the specified file.
P6INT64 P6TIME
The wallclock time represented as the number of microseconds since midnight January 1 1970 UTC...
virtual P6R::P6ERR getRSAPrivateKey(P6BSTR *pN, P6BSTR *pD, P6BSTR *pE, P6BSTR *pP, P6BSTR *pQ, P6BSTR *pPrimeExpP, P6BSTR *pPrimeExpQ, P6BSTR *pCRT)=0
This method retrieves the standard parts of a RSA private key.
P6CRYPTOKEYCLASS keyClass
virtual P6R::P6ERR loadRawSymetricKey(const P6VOID *pBuffer, P6UINT32 cBuffer, P6UINT32 keySize)=0
Load the random bytes that comprise a symetric key into the component.
virtual P6R::P6ERR loadRawPublicRSAKey(const P6UCHAR *pE, P6UINT32 eLength, const P6UCHAR *pN, P6UINT32 nLength)=0
This method loads the standard parts of a RSA public key from a set of buffers.
P6UINT32 P6CRYPTOKEYMASK
P6CRYPTOKEYMASK.
virtual P6R::P6ERR getSymetricIV(P6UCHAR *pBuffer, P6UINT32 cBuffer, P6UINT32 *pWritten)=0
This method retrieves the raw bits of a symetric initialization vector (IV).
When a key is written to a file it is stamped with a set of meta data that define the key...
virtual P6R::P6ERR loadRawPrivateRSAKey(const P6R::P6UCHAR *pN, P6R::P6UINT32 nLength, const P6R::P6UCHAR *pD, P6R::P6UINT32 dLength, const P6R::P6UCHAR *pE, P6R::P6UINT32 eLength, const P6R::P6UCHAR *pP, P6R::P6UINT32 pLength, const P6R::P6UCHAR *pQ, P6R::P6UINT32 qLength, const P6R::P6UCHAR *pPrimeExpP, P6R::P6UINT32 epLength, const P6R::P6UCHAR *pPrimeExpQ, P6R::P6UINT32 eqLength, const P6R::P6UCHAR *pCRT, P6R::P6UINT32 cLength)=0
This method loads the standard parts of a RSA private key from a set of buffers.