Top Fields Constructors Methods
org.bouncycastle.openpgp.operator.bc

public Class BcPBESecretKeyEncryptorBuilder

extends Object
Class Inheritance
Imports
java.security.SecureRandom, org.bouncycastle.crypto.BlockCipher, .InvalidCipherTextException, org.bouncycastle.openpgp.PGPException, org.bouncycastle.openpgp.operator.PBESecretKeyEncryptor, .PGPDigestCalculator

Field Summary

Modifier and TypeField and Description
private int
private SecureRandom
private int
private PGPDigestCalculator

Constructor Summary

AccessConstructor and Description
public
public
BcPBESecretKeyEncryptorBuilder(int
encryption algorithm to use.
encAlgorithm
,
int
iteration count to use for S2K function.
s2kCount
)

Create an SecretKeyEncryptorBuilder with the S2K count different to the default of 0x60.

public
BcPBESecretKeyEncryptorBuilder(int
encryption algorithm to use.
encAlgorithm
,
PGPDigestCalculator
digest calculator to use.
s2kDigestCalculator
)

Create a builder which will make encryptors using the passed in digest calculator.

public
BcPBESecretKeyEncryptorBuilder(int
encryption algorithm to use.
encAlgorithm
,
PGPDigestCalculator
digest calculator to use.
s2kDigestCalculator
,
int
iteration count to use for S2K function.
s2kCount
)

Create an SecretKeyEncryptorBuilder with the S2k count different to the default of 0x60, and the S2K digest different from SHA-1.

Method Summary

Modifier and TypeMethod and Description
public PBESecretKeyEncryptor
build(char[] passPhrase)

public BcPBESecretKeyEncryptorBuilder

Returns:

the current builder.
setSecureRandom
(SecureRandom
the secure random to be used.
random
)

Provide a user defined source of randomness.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

encAlgorithmback to summary
private int encAlgorithm
randomback to summary
private SecureRandom random
s2kCountback to summary
private int s2kCount
s2kDigestCalculatorback to summary
private PGPDigestCalculator s2kDigestCalculator

Constructor Detail

BcPBESecretKeyEncryptorBuilderback to summary
public BcPBESecretKeyEncryptorBuilder(int encAlgorithm)
BcPBESecretKeyEncryptorBuilderback to summary
public BcPBESecretKeyEncryptorBuilder(int encAlgorithm, int s2kCount)

Create an SecretKeyEncryptorBuilder with the S2K count different to the default of 0x60.

Parameters
encAlgorithm:int

encryption algorithm to use.

s2kCount:int

iteration count to use for S2K function.

BcPBESecretKeyEncryptorBuilderback to summary
public BcPBESecretKeyEncryptorBuilder(int encAlgorithm, PGPDigestCalculator s2kDigestCalculator)

Create a builder which will make encryptors using the passed in digest calculator. If a MD5 calculator is passed in the builder will assume the encryptors are for use with version 3 keys.

Parameters
encAlgorithm:int

encryption algorithm to use.

s2kDigestCalculator:PGPDigestCalculator

digest calculator to use.

BcPBESecretKeyEncryptorBuilderback to summary
public BcPBESecretKeyEncryptorBuilder(int encAlgorithm, PGPDigestCalculator s2kDigestCalculator, int s2kCount)

Create an SecretKeyEncryptorBuilder with the S2k count different to the default of 0x60, and the S2K digest different from SHA-1.

Parameters
encAlgorithm:int

encryption algorithm to use.

s2kDigestCalculator:PGPDigestCalculator

digest calculator to use.

s2kCount:int

iteration count to use for S2K function.

Method Detail

buildback to summary
public PBESecretKeyEncryptor build(char[] passPhrase)
setSecureRandomback to summary
public BcPBESecretKeyEncryptorBuilder setSecureRandom(SecureRandom random)

Provide a user defined source of randomness.

Parameters
random:SecureRandom

the secure random to be used.

Returns:BcPBESecretKeyEncryptorBuilder

the current builder.