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

public Class JcePBESecretKeyEncryptorBuilder

extends Object
Class Inheritance
Imports
java.security.InvalidAlgorithmParameterException, .InvalidKeyException, .Provider, .SecureRandom, javax.crypto.BadPaddingException, .Cipher, .IllegalBlockSizeException, javax.crypto.spec.IvParameterSpec, org.bouncycastle.jcajce.util.DefaultJcaJceHelper, .NamedJcaJceHelper, .ProviderJcaJceHelper, org.bouncycastle.openpgp.PGPException, .PGPUtil, org.bouncycastle.openpgp.operator.PBESecretKeyEncryptor, .PGPDigestCalculator

Field Summary

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

Constructor Summary

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

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

public
JcePBESecretKeyEncryptorBuilder(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
JcePBESecretKeyEncryptorBuilder(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 JcePBESecretKeyEncryptorBuilder
public JcePBESecretKeyEncryptorBuilder
setProvider(String providerName)

public JcePBESecretKeyEncryptorBuilder

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
helperback to summary
private OperatorHelper helper
randomback to summary
private SecureRandom random
s2kCountback to summary
private int s2kCount
s2kDigestCalculatorback to summary
private PGPDigestCalculator s2kDigestCalculator

Constructor Detail

JcePBESecretKeyEncryptorBuilderback to summary
public JcePBESecretKeyEncryptorBuilder(int encAlgorithm)
JcePBESecretKeyEncryptorBuilderback to summary
public JcePBESecretKeyEncryptorBuilder(int encAlgorithm, int s2kCount)

Create a 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.

JcePBESecretKeyEncryptorBuilderback to summary
public JcePBESecretKeyEncryptorBuilder(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.

JcePBESecretKeyEncryptorBuilderback to summary
public JcePBESecretKeyEncryptorBuilder(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)
setProviderback to summary
public JcePBESecretKeyEncryptorBuilder setProvider(Provider provider)
setProviderback to summary
public JcePBESecretKeyEncryptorBuilder setProvider(String providerName)
setSecureRandomback to summary
public JcePBESecretKeyEncryptorBuilder setSecureRandom(SecureRandom random)

Provide a user defined source of randomness.

Parameters
random:SecureRandom

the secure random to be used.

Returns:JcePBESecretKeyEncryptorBuilder

the current builder.