public interface PGPDataEncryptorBuilder
PGPDataEncryptor
instances, which can be used to encrypt data objects.Modifier and Type | Method and Description |
---|---|
PGPDataEncryptor |
build(byte[] keyBytes)
Builds a data encryptor using the algorithm configured for this builder.
|
int |
getAeadAlgorithm() |
int |
getAlgorithm()
The encryption algorithm used by data encryptors created by this builder.
|
int |
getChunkSize() |
java.security.SecureRandom |
getSecureRandom()
Gets the SecureRandom instance used by this builder.
|
boolean |
isV5StyleAEAD() |
PGPDataEncryptorBuilder |
setUseV5AEAD()
Specify we are using V5 AEAD.
|
PGPDataEncryptorBuilder |
setUseV6AEAD()
Specify we are using V6 AEAD.
|
PGPDataEncryptorBuilder |
setWithAEAD(int aeadAlgorithm,
int chunkSize)
Sets whether the resulting encrypted data will be protected using an AEAD mode.
|
PGPDataEncryptorBuilder |
setWithIntegrityPacket(boolean withIntegrityPacket)
Sets whether or not the resulting encrypted data will be protected using an integrity packet.
|
int getAlgorithm()
symmetric encryption algorithms
.int getAeadAlgorithm()
int getChunkSize()
boolean isV5StyleAEAD()
PGPDataEncryptor build(byte[] keyBytes) throws PGPException
keyBytes
- the bytes of the key to use for the cipher.PGPException
- if an error occurs initialising the configured encryption.java.security.SecureRandom getSecureRandom()
If a SecureRandom has not been explicitly configured, a default SecureRandom
is
constructed and retained by the this builder.
PGPDataEncryptorBuilder setWithIntegrityPacket(boolean withIntegrityPacket)
withIntegrityPacket
- true if an integrity packet is to be included, false otherwise.PGPDataEncryptorBuilder setWithAEAD(int aeadAlgorithm, int chunkSize)
aeadAlgorithm
- the AEAD mode to use.chunkSize
- the size of the chunks to be processed with each nonce.PGPDataEncryptorBuilder setUseV5AEAD()
PGPDataEncryptorBuilder setUseV6AEAD()