The encryptStart(), encryptContinue(), and encryptEnd() methods comprise a streaming encryption interface.
A streaming interface allows the caller to encrypt blocks of data at a time and does not require all the entire message be contained in a single buffer in order to perform encryption. The encryptContinue() method can be called multiple times, one for each block of data to be encrypted while the encryptStart() and encryptEnd() are only called once.
Even after all data to be encrypted has been input via the encryptContinue() method a final decrypted block can be returned by this method. This method must be called at the end of an encryption session.
- Parameters
-
pOutData | [ in ] Specifies where to place the encrypted data. |
pOutSize | [ in ] Size in bytes of the pOutData array. [ out ] Specifies the number of encrypted bytes written into pOutData. |
- Returns
Success | P6R::eOk | |
Failure | P6R::eNotInitialized | A successful call to initialize was not made before this call. |
P6R::eInvalidArg | One of the parameters is NULL. |
P6R::eInvalidState | A successful call to encryptStart() must be done before a call to this method. |
P6R::eFailAndException | The encryption calculation failed. Exception record provides detailed error info. |
P6R::eTooSmall | The pOutData buffer is too small to hold the encrypted result data. |