public class BcPBEKeyEncryptionMethodGenerator extends PBEKeyEncryptionMethodGenerator
Constructor and Description |
---|
BcPBEKeyEncryptionMethodGenerator(char[] passPhrase)
Create a PBE encryption method generator using the default SHA-1 digest and the default S2K
count for key generation.
|
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.
|
BcPBEKeyEncryptionMethodGenerator(char[] passPhrase,
PGPDigestCalculator s2kDigestCalculator)
Create a PBE encryption method generator using the provided digest and the default S2K count
for key generation.
|
BcPBEKeyEncryptionMethodGenerator(char[] passPhrase,
PGPDigestCalculator s2kDigestCalculator,
int s2kCount)
Create a PBE encryption method generator using the provided calculator and S2K count for key
generation.
|
BcPBEKeyEncryptionMethodGenerator(char[] passPhrase,
S2K.Argon2Params argon2Params)
Create a PBE encryption method generator using Argon2 for S2K key generation.
|
Modifier and Type | Method and Description |
---|---|
protected byte[] |
encryptSessionInfo(int encAlgorithm,
byte[] key,
byte[] sessionInfo) |
PBEKeyEncryptionMethodGenerator |
setSecureRandom(java.security.SecureRandom random)
Sets a user defined source of randomness.
|
generate, generateV5, generateV6, getKey, getSessionKeyWrapperAlgorithm, setSessionKeyWrapperAlgorithm
public BcPBEKeyEncryptionMethodGenerator(char[] passPhrase, PGPDigestCalculator s2kDigestCalculator)
passPhrase
- the passphrase to use as the primary source of key material.s2kDigestCalculator
- the digest calculator to use for key calculation.public BcPBEKeyEncryptionMethodGenerator(char[] passPhrase)
passPhrase
- the passphrase to use as the primary source of key material.public BcPBEKeyEncryptionMethodGenerator(char[] passPhrase, S2K.Argon2Params argon2Params)
passPhrase
- passphraseargon2Params
- parameters for argon2public BcPBEKeyEncryptionMethodGenerator(char[] passPhrase, PGPDigestCalculator s2kDigestCalculator, int s2kCount)
passPhrase
- the passphrase to use as the primary source of key material.s2kDigestCalculator
- the digest calculator to use for key calculation.s2kCount
- the single byte S2K
count to use.public BcPBEKeyEncryptionMethodGenerator(char[] passPhrase, int s2kCount)
passPhrase
- the passphrase to use as the primary source of key material.s2kCount
- the single byte S2K
count to use.public PBEKeyEncryptionMethodGenerator setSecureRandom(java.security.SecureRandom random)
PBEKeyEncryptionMethodGenerator
If no SecureRandom is configured, a default SecureRandom will be used.
setSecureRandom
in class PBEKeyEncryptionMethodGenerator
protected byte[] encryptSessionInfo(int encAlgorithm, byte[] key, byte[] sessionInfo) throws PGPException
encryptSessionInfo
in class PBEKeyEncryptionMethodGenerator
PGPException