Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
virtual P6R::P6ERR P6R::p6ISymmetricCrypto::setKey ( p6ICryptoKey pKey)
pure virtual

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
SuccessP6R::eOkThe key was successfuilly set.
FailureeNotInitializedA successful call to initialize is required before calling this function.
eWrongKeySizeThe cipher selected in initialize does not support the key size of the input key.
eWrongKeyClassThe input key is not a symetric key type.