This method is used to encrypt data using the cipher the component was initialized with.
The method setKey() must have been called prior to calling this method.
Note, that the value passed in pIV and cIV is ignored when a P6CRYPTOCIPHER::CIPHER_AES_CTR is in use. When a P6CRYPTOCIPHER::CIPHER_AES_CTR is in use, at least one call to setAESCounter() must be called before this method is called.
- Parameters
-
pInData | [ in ] Specifies the data to be encrypted. |
pOutData | [ in ] Specifies where to place the encrypted data. |
pIV | [ in ] This a pointer to the initialization vector to be used for encrypting the data. |
cIV | [ in ] This is number of bytes in pIV and must be at least P6CRYPTOIVLEN bytes long. |
- Returns
Success | P6R::eOk | |
Failure | P6R::eNotInitialized | A successful call to initialize was not made before this call. |
P6R::eFormatError | loadSymetricKey has not been successfully invoked. |
P6R::eInvalidArg | One of the parameters is NULL. |
P6R::eNotFound | File data source does not exist. |
P6R::eInvalidDescriptor | The requested cipher and key size is not supported. |
P6R::eIoError | Write to file data sink failed. |
P6R::eTooSmall | The buffer data sink is too small to contain the generated value. |
P6R::eNoMemory/td> | Insufficent memory for buffering. |
P6R::eFailAndException | The encryption calculation failed. Exception record provides detailed error info. |