Interface EncryptionHandler
-
public interface EncryptionHandler
Implements specific encryption and decryption algorithms.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description EncryptionHandlerState
createEncryptionHandlerState()
byte[]
decrypt(byte[] src, byte[] addKey)
Decrypts the byte array with the encryption key calculated from the base encryption key held in the implementation and the addKey which is an addition to the base key.void
decrypt(InputByteStream src, OutputByteStream dest, byte[] addKey)
Decrypts the byte stream with the encryption key calculated from the base encryption key held in the implementation and the addKey which is an addition to the base key.byte[]
encrypt(byte[] src, byte[] addKey)
Encrypts the byte array with the encryption key calculated from the base encryption key held in the implementation and the addKey which is an addition to the base key.void
encrypt(InputByteStream src, OutputByteStream dest, byte[] addKey)
Encrypts the byte stream with the encryption key calculated from the base encryption key held in the implementation and the addKey which is an addition to the base key.
-
-
-
Method Detail
-
encrypt
byte[] encrypt(byte[] src, byte[] addKey) throws PDFSecurityConfigurationException
Encrypts the byte array with the encryption key calculated from the base encryption key held in the implementation and the addKey which is an addition to the base key.The encryption algorithm depends on a particular implementation of this class.
- Parameters:
src
- the input byte array.addKey
- the addition to the encryption key.- Returns:
- encrypted byte array.
- Throws:
PDFSecurityConfigurationException
-
encrypt
void encrypt(InputByteStream src, OutputByteStream dest, byte[] addKey) throws PDFIOException, PDFSecurityConfigurationException
Encrypts the byte stream with the encryption key calculated from the base encryption key held in the implementation and the addKey which is an addition to the base key.The encryption algorithm depends on a particular implementation of this class.
- Parameters:
src
- the input byte stream.dest
- the output stream of bytesaddKey
- the addition to the encryption key.- Throws:
PDFSecurityConfigurationException
PDFIOException
-
decrypt
byte[] decrypt(byte[] src, byte[] addKey) throws PDFSecurityConfigurationException
Decrypts the byte array with the encryption key calculated from the base encryption key held in the implementation and the addKey which is an addition to the base key.The encryption algorithm depends on a particular implementation of this class.
- Parameters:
src
- the input byte array.addKey
- the addition to the encryption key.- Returns:
- decrypted byte array.
- Throws:
PDFSecurityConfigurationException
-
decrypt
void decrypt(InputByteStream src, OutputByteStream dest, byte[] addKey) throws PDFIOException, PDFSecurityConfigurationException
Decrypts the byte stream with the encryption key calculated from the base encryption key held in the implementation and the addKey which is an addition to the base key.
The encryption algorithm depends on a particular implementation of this class.
- Parameters:
src
- an input stream of bytes.dest
- the output stream of bytesaddKey
- the addition to the encryption key.- Throws:
PDFIOException
PDFSecurityConfigurationException
-
createEncryptionHandlerState
EncryptionHandlerState createEncryptionHandlerState() throws PDFSecurityConfigurationException
- Returns:
- EncryptionHandlerState object associated with this EncryptionHandler for sequential decryption/encryption of a data stream.
- Throws:
PDFSecurityConfigurationException
-
-