public class JcePBEKeyEncryptionMethodGenerator extends PBEKeyEncryptionMethodGenerator
Constructor and Description |
---|
JcePBEKeyEncryptionMethodGenerator(char[] passPhrase)
Create a PBE encryption method generator using the default SHA-1 digest calculator for key calculation.
|
JcePBEKeyEncryptionMethodGenerator(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 of 0x60 for key calculation
|
JcePBEKeyEncryptionMethodGenerator(char[] passPhrase,
PGPDigestCalculator s2kDigestCalculator)
Create a PBE encryption method generator using the provided calculator for key calculation.
|
JcePBEKeyEncryptionMethodGenerator(char[] passPhrase,
PGPDigestCalculator s2kDigestCalculator,
int s2kCount)
Create a PBE encryption method generator using the provided calculator and S2K count for key calculation.
|
Modifier and Type | Method and Description |
---|---|
protected byte[] |
encryptSessionInfo(int encAlgorithm,
byte[] key,
byte[] sessionInfo) |
JcePBEKeyEncryptionMethodGenerator |
setProvider(java.security.Provider provider) |
JcePBEKeyEncryptionMethodGenerator |
setProvider(java.lang.String providerName) |
PBEKeyEncryptionMethodGenerator |
setSecureRandom(java.security.SecureRandom random)
Provide a user defined source of randomness.
|
generate, getKey
public JcePBEKeyEncryptionMethodGenerator(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 JcePBEKeyEncryptionMethodGenerator(char[] passPhrase)
passPhrase
- the passphrase to use as the primary source of key material.public JcePBEKeyEncryptionMethodGenerator(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 S2K count to use.public JcePBEKeyEncryptionMethodGenerator(char[] passPhrase, int s2kCount)
passPhrase
- the passphrase to use as the primary source of key material.s2kCount
- the S2K count to use.public JcePBEKeyEncryptionMethodGenerator setProvider(java.security.Provider provider)
public JcePBEKeyEncryptionMethodGenerator setProvider(java.lang.String providerName)
public PBEKeyEncryptionMethodGenerator setSecureRandom(java.security.SecureRandom random)
setSecureRandom
in class PBEKeyEncryptionMethodGenerator
random
- the secure random to be used.protected byte[] encryptSessionInfo(int encAlgorithm, byte[] key, byte[] sessionInfo) throws PGPException
encryptSessionInfo
in class PBEKeyEncryptionMethodGenerator
PGPException