Package com.dracoon.sdk.crypto
Interface FileEncryptionCipher
- All Known Implementing Classes:
AesGcmFileEncryptionCipher
public interface FileEncryptionCipher
Interface representing a cipher for the Dracoon file encryption.
-
Method Summary
Modifier and TypeMethodDescriptiondoFinal()Completes the encryption and calculates a kind of checksum which is later used at the decryption to verify the integrity of decrypted bytes.
After this method is called no further calls ofprocessBytesanddoFinalare possible.processBytes(PlainDataContainer plainData) Encrypts some bytes.
IMPORTANT!!!: After all plain bytes have been processed,doFinalmust be called to complete the encryption.
-
Method Details
-
processBytes
EncryptedDataContainer processBytes(PlainDataContainer plainData) throws IllegalArgumentException, IllegalStateException, CryptoSystemException Encrypts some bytes.
IMPORTANT!!!: After all plain bytes have been processed,doFinalmust be called to complete the encryption. Otherwise the encryption is not finished and the encrypted bytes can't later be decrypted.- Parameters:
plainData- The data container with the bytes to encrypt.- Returns:
- The data container with the encrypted 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
Completes the encryption and calculates a kind of checksum which is later used at the decryption to verify the integrity of decrypted bytes.
After this method is called no further calls ofprocessBytesanddoFinalare possible.- Returns:
- The data container with the encrypted bytes and the calculated tag.
- Throws:
IllegalStateException- If the cipher is in an inappropriate state.CryptoSystemException- If a unknown error occurred.
-