Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
virtual P6R::P6ERR P6R::p6IGenKeys2::localizeSnmpKey ( p6ICryptoKey pInKey,
p6ICryptoKey **  ppOutKey,
const P6CHAR pEngineID,
P6UINT32  idSize,
p6IEntropySource pEntropy 
)
pure virtual

Takes a symmetric key and "localizes" it with the byte sequence pointed to by "pEngineID".

This function generates a new symetric key and saves it into the file named by the parameter "pKeyFile" in PEM format. (This includes generating a new IV for the localized key.) Note, that currently the generated key file is not encrypted.

Parameters
pInKey[ in ] A pointer to a p6ICryptoKey interface containing the master key to localize.
ppOutKey[ out ] The address of a p6ICryptoKey interface pointer in which will be placed the localized key.
pEngineID[ in ] SNMP specific string of variable length. This can be a binary byte sequence (i.e., not NULL terminated).
idSize[ in ] The number of bytes of data pointed to by pEngineID.
pEntropy[ in ] Pointer to a plugin interface to provide the entropy requried for key generation. If set to NULL, then a default entropy source will be used.
Returns
SuccessP6R::eOk 
FailureeInvalidArgOne of the parameters is NULL or idSize is zero.
eNotInitializedA successful call to initialize was not made before this call.
eIoErrorCould not create the key file.
eFormatErrorA symetric key has not been loaded before this call.
eFailThe key generation calculation failed.