This method is used to specify which key to use for encryption and/or decryption.
This method must be called prior to calling the encrypt() or decrypt() methods. Note that in symetric encryption the same key is used for both encryption and decryption, The key size must be compatible with the cipher being used.
- AES 128, 192, 256 bits
- Blowfish variable to 448 bits
- CAST5 40 to 128 bits in 8 bit multiples
- DES, DESX, DES3 64 bits
- RC2 variable up to 128 bits
- Parameters
-
pKey | [ in ] A pointer to the p6ICryptoKey interface representing the key to use for crypto operations. This key must be compatible with the cipher that was set in the initialize method. |
- Returns
Success | P6R::eOk | The key was successfuilly set. |
Failure | eNotInitialized | A successful call to initialize is required before calling this function. |
eWrongKeySize | The cipher selected in initialize does not support the key size of the input key. |
eWrongKeyClass | The input key is not a symetric key type. |