Package com.dracoon.sdk.crypto
Interface FileDecryptionCipher
- All Known Implementing Classes:
AesGcmFileDecryptionCipher
public interface FileDecryptionCipher
Interface representing a cipher for the Dracoon file decryption.
-
Method Summary
Modifier and TypeMethodDescriptiondoFinal(EncryptedDataContainer encData) Completes the decryption and verifies the integrity of decrypted bytes.
After this method is called no further calls ofprocessBytesanddoFinalare possible.processBytes(EncryptedDataContainer encData) Decrypts some bytes.
IMPORTANT!!!: After all encrypted bytes have been processed,doFinalmust be called to complete the decryption.
-
Method Details
-
processBytes
PlainDataContainer processBytes(EncryptedDataContainer encData) throws IllegalArgumentException, IllegalStateException, CryptoSystemException Decrypts some bytes.
IMPORTANT!!!: After all encrypted bytes have been processed,doFinalmust be called to complete the decryption. As long as the decryption is not finished, the integrity of the decrypted bytes is not guaranteed!- Parameters:
encData- The data container with the bytes to decrypt.- Returns:
- The data container with the decrypted bytes.
- Throws:
IllegalArgumentException- If the data container is invalid.IllegalStateException- If the cipher is in an inappropriate state.CryptoSystemException- If a unknown error occurred.
-
doFinal
PlainDataContainer doFinal(EncryptedDataContainer encData) throws BadFileException, IllegalArgumentException, IllegalStateException, CryptoSystemException Completes the decryption and verifies the integrity of decrypted bytes.
After this method is called no further calls ofprocessBytesanddoFinalare possible.- Parameters:
encData- The data container with the previously calculated tag.- Returns:
- The data container with the decrypted bytes.
- Throws:
BadFileException- If the file content has been modified.IllegalArgumentException- If the data container is invalid.IllegalStateException- If the cipher is in an inappropriate state.CryptoSystemException- If a unknown error occurred.
-