Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
p6genkeys.h
Go to the documentation of this file.
1 
11 #ifndef P6GENKEYS_H__
12 #define P6GENKEYS_H__ 1
13 
14 #include "p6random.h"
15 #include "p6cryptokey.h"
16 
17 namespace P6R {
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
33 const P6GENKEYFLAGS P6GENKEY_NOFLAGS = 0x00000000;
34 const P6GENKEYFLAGS P6GENKEY_TRACEON = 0x00000001;
35 
36 
42 interface p6IGenKeys : public p6ICom
43 {
59  P6COMMETHOD initialize( P6GENKEYFLAGS flags, p6IRandom* pRandom ) = 0;
60 
80  P6COMMETHOD genDSAKeyPair( p6ICryptoKey** ppPubKey, p6ICryptoKey** ppPrvKey, P6UINT32 keySize ) = 0;
81 
100  P6COMMETHOD genRSAKeyPair( p6ICryptoKey** ppPubKey, p6ICryptoKey** ppPrvKey, P6UINT32 keySize ) = 0;
101 
122  P6COMMETHOD genSymmetricKeyRaw( P6UCHAR* pKeyBuffer, P6INT32 cKeyBuffer, P6UINT32 keySize, P6BOOL bReseed ) = 0;
123 
145  P6COMMETHOD genSymmetricKey( p6ICryptoKey** ppKey, P6UINT32 keySize, P6BOOL bReseed ) = 0;
146 
165  P6COMMETHOD genSymmetricKeyFromData( p6ICryptoKey** ppKey, P6CHAR *pData, P6UINT32 cData ) = 0;
166 
190  P6COMMETHOD localizeSnmpKey( p6ICryptoKey* pInKey, p6ICryptoKey** ppOutKey, const P6CHAR* pEngineID, P6UINT32 idSize, p6IEntropySource* pEntropy ) = 0;
191 };
192 
193 // {18150F93-5C77-426b-9C47-671203BC808C}
194 #define IF_p6IGenKeys {0x18150f93,0x5c77,0x426b,{0x9c,0x47,0x67,0x12,0x3,0xbc,0x80,0x8c}}
195 
196 
202 interface p6IGenKeys2 : public p6ICom
203 {
219  P6COMMETHOD initialize( P6GENKEYFLAGS flags, p6IRandom* pRandom ) = 0;
220 
240  P6COMMETHOD genDSAKeyPair( p6ICryptoKey** ppPubKey, p6ICryptoKey** ppPrvKey, P6UINT32 keySize ) = 0;
241 
260  P6COMMETHOD genRSAKeyPair( p6ICryptoKey** ppPubKey, p6ICryptoKey** ppPrvKey, P6UINT32 keySize ) = 0;
261 
282  P6COMMETHOD genSymmetricKeyRaw( P6UCHAR* pKeyBuffer, P6INT32 cKeyBuffer, P6UINT32 keySize, P6BOOL bReseed ) = 0;
283 
305  P6COMMETHOD genSymmetricKey( p6ICryptoKey** ppKey, P6UINT32 keySize, P6BOOL bReseed ) = 0;
306 
325  P6COMMETHOD genSymmetricKeyFromData( p6ICryptoKey** ppKey, P6CHAR* pData, P6UINT32 cData ) = 0;
326 
350  P6COMMETHOD localizeSnmpKey( p6ICryptoKey* pInKey, p6ICryptoKey** ppOutKey, const P6CHAR* pEngineID, P6UINT32 idSize, p6IEntropySource* pEntropy ) = 0;
351 
370  P6COMMETHOD genECKeyPair( P6ECCURVE curveId, P6CRYPTOCIPHER cipher, p6ICryptoKey** ppPubKey, p6ICryptoKey** ppPrvKey ) = 0;
371 };
372 
373 // {64CF2209-655B-4b81-959C-C5FB3170312D}
374 #define IF_p6IGenKeys2 {0x64cf2209,0x655b,0x4b81,{0x95,0x9c,0xc5,0xfb,0x31,0x70,0x31,0x2d}}
375 
376 
377 // {2F884654-A993-4901-97C3-8881BFA15F9C}
378 #define COMP_p6GenKeys {0x2f884654,0xa993,0x4901,{0x97,0xc3,0x88,0x81,0xbf,0xa1,0x5f,0x9c}}
379 
380 #ifdef __cplusplus
381 }
382 #endif
383 
384 } // namespace
385 
386 
387 #endif
388 
389 
virtual P6R::P6ERR genSymmetricKeyRaw(P6UCHAR *pKeyBuffer, P6INT32 cKeyBuffer, P6UINT32 keySize, P6BOOL bReseed)=0
Symetric keys are used for the bulk of encrypting data since PKI encryption is slow.
const P6GENKEYFLAGS P6GENKEY_TRACEON
Definition: p6genkeys.h:34
virtual P6R::P6ERR genDSAKeyPair(p6ICryptoKey **ppPubKey, p6ICryptoKey **ppPrvKey, P6UINT32 keySize)=0
Digital Signature Algorithm (DSA) – Public Key Cryptography Generate a public and private DSA key pai...
unsigned char P6UCHAR
Definition: p6types.h:74
virtual P6R::P6ERR genSymmetricKey(p6ICryptoKey **ppKey, P6UINT32 keySize, P6BOOL bReseed)=0
Symetric keys are used for the bulk of encrypting data since PKI encryption is slow.
This interface provides key metadata infrormation and key access.
Definition: p6cryptokey.h:1100
unsigned int P6UINT32
Definition: p6types.h:40
virtual P6R::P6ERR localizeSnmpKey(p6ICryptoKey *pInKey, p6ICryptoKey **ppOutKey, const P6CHAR *pEngineID, P6UINT32 idSize, p6IEntropySource *pEntropy)=0
Takes a symmetric key and "localizes" it with the byte sequence pointed to by "pEngineID".
bool P6BOOL
Boolean type.
Definition: p6types.h:101
virtual P6R::P6ERR genECKeyPair(P6ECCURVE curveId, P6CRYPTOCIPHER cipher, p6ICryptoKey **ppPubKey, p6ICryptoKey **ppPrvKey)=0
EC Algorithm Generate a public - private EC key pair and save them into the named files in PEM format...
This interface provides key generation methods for all p6Crypto supported ciphers.
Definition: p6genkeys.h:202
virtual P6R::P6ERR genDSAKeyPair(p6ICryptoKey **ppPubKey, p6ICryptoKey **ppPrvKey, P6UINT32 keySize)=0
Digital Signature Algorithm (DSA) – Public Key Cryptography Generate a public and private DSA key pai...
virtual P6R::P6ERR genSymmetricKeyRaw(P6UCHAR *pKeyBuffer, P6INT32 cKeyBuffer, P6UINT32 keySize, P6BOOL bReseed)=0
Symetric keys are used for the bulk of encrypting data since PKI encryption is slow.
[p6]COM Cryptographic Random Number Generator.
virtual P6R::P6ERR genSymmetricKey(p6ICryptoKey **ppKey, P6UINT32 keySize, P6BOOL bReseed)=0
Symetric keys are used for the bulk of encrypting data since PKI encryption is slow.
P6UINT32 P6GENKEYFLAGS
P6GENKEYFLAGS.
Definition: p6genkeys.h:32
P6CRYPTOCIPHER
Cipher Type.
Definition: p6crypto.h:113
int P6INT32
Definition: p6types.h:41
The base interface all [p6]COM components must derive from and implement.
Definition: p6comdef.h:96
This interface provides key generation methods for all p6Crypto supported ciphers.
Definition: p6genkeys.h:42
Provides a cryptographically strong random number generator.
Definition: p6random.h:70
virtual P6R::P6ERR genSymmetricKeyFromData(p6ICryptoKey **ppKey, P6CHAR *pData, P6UINT32 cData)=0
This method allows the creation of a symmetric key from existing data supplied by the caller...
P6ECCURVE
EC Curve Type.
Definition: p6crypto.h:175
virtual P6R::P6ERR genRSAKeyPair(p6ICryptoKey **ppPubKey, p6ICryptoKey **ppPrvKey, P6UINT32 keySize)=0
RSA Algorithm Generate a public - private RSA key pair and save them in p6ICryptoKey objects...
This is a plugin interface for the customer of the ICrypto interface to enhance the built in entropy ...
Definition: p6entropy.h:58
const P6GENKEYFLAGS P6GENKEY_NOFLAGS
Definition: p6genkeys.h:33
virtual P6R::P6ERR genSymmetricKeyFromData(p6ICryptoKey **ppKey, P6CHAR *pData, P6UINT32 cData)=0
This method allows the creation of a symmetric key from existing data supplied by the caller...
#define P6COMMETHOD
Definition: p6types.h:917
virtual P6R::P6ERR initialize(P6GENKEYFLAGS flags, p6IRandom *pRandom)=0
Sets up the object to run properly.
virtual P6R::P6ERR localizeSnmpKey(p6ICryptoKey *pInKey, p6ICryptoKey **ppOutKey, const P6CHAR *pEngineID, P6UINT32 idSize, p6IEntropySource *pEntropy)=0
Takes a symmetric key and "localizes" it with the byte sequence pointed to by "pEngineID".
virtual P6R::P6ERR initialize(P6GENKEYFLAGS flags, p6IRandom *pRandom)=0
Sets up the object to run properly.
virtual P6R::P6ERR genRSAKeyPair(p6ICryptoKey **ppPubKey, p6ICryptoKey **ppPrvKey, P6UINT32 keySize)=0
RSA Algorithm Generate a public - private RSA key pair and return them in p6ICryptoKey objects...
char P6CHAR
Narrow character type.
Definition: p6types.h:71
P6R Cryptographic key interface definitions.