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

public Class BcPBEKeyEncryptionMethodGenerator

extends PBEKeyEncryptionMethodGenerator
Class Inheritance
Imports
java.security.SecureRandom, org.bouncycastle.bcpg.S2K, .SymmetricKeyUtils, org.bouncycastle.crypto.BlockCipher, .InvalidCipherTextException, org.bouncycastle.openpgp.PGPException, org.bouncycastle.openpgp.operator.PBEKeyEncryptionMethodGenerator, .PGPDigestCalculator

A BC lightweight method generator for supporting PBE based encryption operations.

Constructor Summary

AccessConstructor and Description
public
BcPBEKeyEncryptionMethodGenerator(char[]
the passphrase to use as the primary source of key material.
passPhrase
,
PGPDigestCalculator
the digest calculator to use for key calculation.
s2kDigestCalculator
)

Create a PBE encryption method generator using the provided digest and the default S2K count for key generation.

public
BcPBEKeyEncryptionMethodGenerator(char[]
the passphrase to use as the primary source of key material.
passPhrase
)

Create a PBE encryption method generator using the default SHA-1 digest and the default S2K count for key generation.

public
BcPBEKeyEncryptionMethodGenerator(char[]
passphrase
passPhrase
,
S2K.Argon2Params
parameters for argon2
argon2Params
)

Create a PBE encryption method generator using Argon2 for S2K key generation.

public
BcPBEKeyEncryptionMethodGenerator(char[]
the passphrase to use as the primary source of key material.
passPhrase
,
PGPDigestCalculator
the digest calculator to use for key calculation.
s2kDigestCalculator
,
int
the single byte S2K count to use.
s2kCount
)

Create a PBE encryption method generator using the provided calculator and S2K count for key generation.

public
BcPBEKeyEncryptionMethodGenerator(char[]
the passphrase to use as the primary source of key material.
passPhrase
,
int
the single byte S2K count to use.
s2kCount
)

Create a PBE encryption method generator using the default SHA-1 digest calculator and a S2K count other than the default for key generation.

Method Summary

Modifier and TypeMethod and Description
protected byte[]
encryptSessionInfo(int encAlgorithm, byte[] key, byte[] sessionInfo)

Implements abstract org.bouncycastle.openpgp.operator.PBEKeyEncryptionMethodGenerator.encryptSessionInfo.

protected byte[]
generateV6KEK(int kekAlgorithm, byte[] ikm, byte[] info)

Implements abstract org.bouncycastle.openpgp.operator.PBEKeyEncryptionMethodGenerator.generateV6KEK.

protected byte[]
getEskAndTag(int kekAlgorithm, int aeadAlgorithm, byte[] sessionKey, byte[] key, byte[] iv, byte[] info)

Implements abstract org.bouncycastle.openpgp.operator.PBEKeyEncryptionMethodGenerator.getEskAndTag.

public PBEKeyEncryptionMethodGenerator
Inherited from org.bouncycastle.openpgp.operator.PBEKeyEncryptionMethodGenerator:
generategetKeygetSessionKeyWrapperAlgorithmsetSessionKeyWrapperAlgorithm

Constructor Detail

BcPBEKeyEncryptionMethodGeneratorback to summary
public BcPBEKeyEncryptionMethodGenerator(char[] passPhrase, PGPDigestCalculator s2kDigestCalculator)

Create a PBE encryption method generator using the provided digest and the default S2K count for key generation.

Parameters
passPhrase:char[]

the passphrase to use as the primary source of key material.

s2kDigestCalculator:PGPDigestCalculator

the digest calculator to use for key calculation.

BcPBEKeyEncryptionMethodGeneratorback to summary
public BcPBEKeyEncryptionMethodGenerator(char[] passPhrase)

Create a PBE encryption method generator using the default SHA-1 digest and the default S2K count for key generation.

Parameters
passPhrase:char[]

the passphrase to use as the primary source of key material.

BcPBEKeyEncryptionMethodGeneratorback to summary
public BcPBEKeyEncryptionMethodGenerator(char[] passPhrase, S2K.Argon2Params argon2Params)

Create a PBE encryption method generator using Argon2 for S2K key generation.

Parameters
passPhrase:char[]

passphrase

argon2Params:S2K.Argon2Params

parameters for argon2

BcPBEKeyEncryptionMethodGeneratorback to summary
public BcPBEKeyEncryptionMethodGenerator(char[] passPhrase, PGPDigestCalculator s2kDigestCalculator, int s2kCount)

Create a PBE encryption method generator using the provided calculator and S2K count for key generation.

Parameters
passPhrase:char[]

the passphrase to use as the primary source of key material.

s2kDigestCalculator:PGPDigestCalculator

the digest calculator to use for key calculation.

s2kCount:int

the single byte S2K count to use.

BcPBEKeyEncryptionMethodGeneratorback to summary
public BcPBEKeyEncryptionMethodGenerator(char[] passPhrase, int s2kCount)

Create a PBE encryption method generator using the default SHA-1 digest calculator and a S2K count other than the default for key generation.

Parameters
passPhrase:char[]

the passphrase to use as the primary source of key material.

s2kCount:int

the single byte S2K count to use.

Method Detail

encryptSessionInfoback to summary
protected byte[] encryptSessionInfo(int encAlgorithm, byte[] key, byte[] sessionInfo) throws PGPException

Implements abstract org.bouncycastle.openpgp.operator.PBEKeyEncryptionMethodGenerator.encryptSessionInfo.

generateV6KEKback to summary
protected byte[] generateV6KEK(int kekAlgorithm, byte[] ikm, byte[] info)

Implements abstract org.bouncycastle.openpgp.operator.PBEKeyEncryptionMethodGenerator.generateV6KEK.

getEskAndTagback to summary
protected byte[] getEskAndTag(int kekAlgorithm, int aeadAlgorithm, byte[] sessionKey, byte[] key, byte[] iv, byte[] info) throws PGPException

Implements abstract org.bouncycastle.openpgp.operator.PBEKeyEncryptionMethodGenerator.getEskAndTag.

setSecureRandomback to summary
public PBEKeyEncryptionMethodGenerator setSecureRandom(SecureRandom random)

Overrides org.bouncycastle.openpgp.operator.PBEKeyEncryptionMethodGenerator.setSecureRandom.

Doc from org.bouncycastle.openpgp.operator.PBEKeyEncryptionMethodGenerator.setSecureRandom.

Sets a user defined source of randomness.

If no SecureRandom is configured, a default SecureRandom will be used.

Returns:PBEKeyEncryptionMethodGenerator

the current generator.