Bouncy Castle Cryptography Library 1.49

org.bouncycastle.openpgp.operator.bc
Class BcPGPDataEncryptorBuilder

java.lang.Object
  extended by org.bouncycastle.openpgp.operator.bc.BcPGPDataEncryptorBuilder
All Implemented Interfaces:
PGPDataEncryptorBuilder

public class BcPGPDataEncryptorBuilder
extends java.lang.Object
implements PGPDataEncryptorBuilder


Constructor Summary
BcPGPDataEncryptorBuilder(int encAlgorithm)
           
 
Method Summary
 PGPDataEncryptor build(byte[] keyBytes)
           
 int getAlgorithm()
           
 java.security.SecureRandom getSecureRandom()
           
 BcPGPDataEncryptorBuilder setSecureRandom(java.security.SecureRandom random)
          Provide a user defined source of randomness.
 BcPGPDataEncryptorBuilder setWithIntegrityPacket(boolean withIntegrityPacket)
          Determine whether or not 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

BcPGPDataEncryptorBuilder

public BcPGPDataEncryptorBuilder(int encAlgorithm)
Method Detail

setWithIntegrityPacket

public BcPGPDataEncryptorBuilder setWithIntegrityPacket(boolean withIntegrityPacket)
Determine whether or not the resulting encrypted data will be protected using an integrity packet.

Parameters:
withIntegrityPacket - true if an integrity packet is to be included, false otherwise.
Returns:
the current builder.

setSecureRandom

public BcPGPDataEncryptorBuilder setSecureRandom(java.security.SecureRandom random)
Provide a user defined source of randomness.

Parameters:
random - the secure random to be used.
Returns:
the current builder.

getAlgorithm

public int getAlgorithm()
Specified by:
getAlgorithm in interface PGPDataEncryptorBuilder

getSecureRandom

public java.security.SecureRandom getSecureRandom()
Specified by:
getSecureRandom in interface PGPDataEncryptorBuilder

build

public PGPDataEncryptor build(byte[] keyBytes)
                       throws PGPException
Specified by:
build in interface PGPDataEncryptorBuilder
Throws:
PGPException

Bouncy Castle Cryptography Library 1.49