Package com.dracoon.sdk.crypto.internal
Class AesGcmFileEncryptionCipher
java.lang.Object
com.dracoon.sdk.crypto.internal.AesGcmFileCipher
com.dracoon.sdk.crypto.internal.AesGcmFileEncryptionCipher
- All Implemented Interfaces:
FileEncryptionCipher
-
Field Summary
Fields inherited from class com.dracoon.sdk.crypto.internal.AesGcmFileCipher
BLOCK_SIZE, realCipher, TAG_SIZE -
Constructor Summary
Constructors -
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.Methods inherited from class com.dracoon.sdk.crypto.internal.AesGcmFileCipher
init, process
-
Constructor Details
-
AesGcmFileEncryptionCipher
- Throws:
CryptoSystemException
-
-
Method Details
-
processBytes
public EncryptedDataContainer processBytes(PlainDataContainer plainData) throws IllegalArgumentException, IllegalStateException, CryptoSystemException Description copied from interface:FileEncryptionCipherEncrypts 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.- Specified by:
processBytesin interfaceFileEncryptionCipher- 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
Description copied from interface:FileEncryptionCipherCompletes 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.- Specified by:
doFinalin interfaceFileEncryptionCipher- 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.
-