|
Bouncy Castle Cryptography Library 1.81 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.bouncycastle.openpgp.operator.bc.BcPGPDataEncryptorBuilder
PGPDataEncryptorBuilder
implementation that uses the Bouncy Castle lightweight API to
implement cryptographic primitives.
Constructor Summary | |
BcPGPDataEncryptorBuilder(int encAlgorithm)
Constructs a new data encryptor builder for a specified cipher type. |
Method Summary | |
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()
|
BcPGPDataEncryptorBuilder |
setSecureRandom(java.security.SecureRandom random)
Provide a user defined source of randomness. |
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 the resulting encrypted data will be protected using an integrity packet. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public BcPGPDataEncryptorBuilder(int encAlgorithm)
encAlgorithm
- one of the supported symmetric cipher
algorithms
. May not be SymmetricKeyAlgorithmTags.NULL
.Method Detail |
public PGPDataEncryptorBuilder setWithIntegrityPacket(boolean withIntegrityPacket)
setWithIntegrityPacket
in interface PGPDataEncryptorBuilder
withIntegrityPacket
- true if an integrity packet is to be included, false otherwise.
public PGPDataEncryptorBuilder setUseV5AEAD()
PGPDataEncryptorBuilder
setUseV5AEAD
in interface PGPDataEncryptorBuilder
public PGPDataEncryptorBuilder setUseV6AEAD()
PGPDataEncryptorBuilder
setUseV6AEAD
in interface PGPDataEncryptorBuilder
public PGPDataEncryptorBuilder setWithAEAD(int aeadAlgorithm, int chunkSize)
setWithAEAD
in interface PGPDataEncryptorBuilder
aeadAlgorithm
- the AEAD mode to use.chunkSize
- the size of the chunks to be processed with each nonce.
public BcPGPDataEncryptorBuilder setSecureRandom(java.security.SecureRandom random)
If no SecureRandom is configured, a default SecureRandom will be used.
random
- the secure random to be used.
public int getAlgorithm()
PGPDataEncryptorBuilder
getAlgorithm
in interface PGPDataEncryptorBuilder
symmetric encryption algorithms
.public int getAeadAlgorithm()
getAeadAlgorithm
in interface PGPDataEncryptorBuilder
public int getChunkSize()
getChunkSize
in interface PGPDataEncryptorBuilder
public boolean isV5StyleAEAD()
isV5StyleAEAD
in interface PGPDataEncryptorBuilder
public java.security.SecureRandom getSecureRandom()
PGPDataEncryptorBuilder
If a SecureRandom has not been explicitly configured, a default SecureRandom
is
constructed and retained by the this builder.
getSecureRandom
in interface PGPDataEncryptorBuilder
public PGPDataEncryptor build(byte[] keyBytes) throws PGPException
PGPDataEncryptorBuilder
build
in interface PGPDataEncryptorBuilder
keyBytes
- the bytes of the key to use for the cipher.
PGPException
- if an error occurs initialising the configured encryption.
|
Bouncy Castle Cryptography Library 1.81 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |