java.lang.Object
org.sejda.sambox.encryption.AESEngineNoPadding
- All Implemented Interfaces:
AESEncryptionAlgorithmEngine,EncryptionAlgorithmEngine
- Direct Known Subclasses:
ConcatenatingAESEngine
AES implementation of a
EncryptionAlgorithmEngine with no pudding-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.bouncycastle.crypto.BufferedBlockCipher -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static AESEngineNoPaddingcbc()(package private) static AESEngineNoPaddingecb()byte[]encryptBytes(byte[] data, byte[] key) byte[]encryptBytes(byte[] data, byte[] key, byte[] iv) encryptStream(InputStream data, byte[] key) encryptStream(InputStream data, byte[] key, byte[] iv) private voidinit(byte[] key, byte[] iv)
-
Field Details
-
cipher
private final org.bouncycastle.crypto.BufferedBlockCipher cipher
-
-
Constructor Details
-
AESEngineNoPadding
AESEngineNoPadding(org.bouncycastle.crypto.BufferedBlockCipher cipher)
-
-
Method Details
-
encryptStream
- Specified by:
encryptStreamin interfaceAESEncryptionAlgorithmEngine- Returns:
- a stream encrypted with the given key and initialization vector
-
encryptStream
- Specified by:
encryptStreamin interfaceEncryptionAlgorithmEngine- Parameters:
data- data to encrypt- Returns:
- a stream where encrypted data can be read from
-
encryptBytes
public byte[] encryptBytes(byte[] data, byte[] key, byte[] iv) - Specified by:
encryptBytesin interfaceAESEncryptionAlgorithmEngine- Returns:
- the byte array encrypted with the given key and initialization vector
-
encryptBytes
public byte[] encryptBytes(byte[] data, byte[] key) - Specified by:
encryptBytesin interfaceEncryptionAlgorithmEngine- Parameters:
data- data to encrypt- Returns:
- the encrypted data
-
init
private void init(byte[] key, byte[] iv) -
cbc
- Returns:
- and instance of EncryptionAlgorithmEngine AES/CBC/NoPadding and no initialization vector
-
ecb
- Returns:
- and instance of EncryptionAlgorithmEngine AES/ECB/NoPadding and no initialization vector
-