Bouncy Castle Cryptography Library 1.47

org.bouncycastle.openpgp.operator.jcajce
Class JcePBEKeyEncryptionMethodGenerator

java.lang.Object
  extended by org.bouncycastle.openpgp.operator.PGPKeyEncryptionMethodGenerator
      extended by org.bouncycastle.openpgp.operator.PBEKeyEncryptionMethodGenerator
          extended by org.bouncycastle.openpgp.operator.jcajce.JcePBEKeyEncryptionMethodGenerator

public class JcePBEKeyEncryptionMethodGenerator
extends PBEKeyEncryptionMethodGenerator

JCE based generator for password based encryption (PBE) data protection methods.


Constructor Summary
JcePBEKeyEncryptionMethodGenerator(char[] passPhrase)
          Create a PBE encryption method generator using the default SHA-1 digest calculator for key calculation.
JcePBEKeyEncryptionMethodGenerator(char[] passPhrase, PGPDigestCalculator s2kDigestCalculator)
          Create a PBE encryption method generator using the provided calculator for key calculation.
 
Method Summary
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.
 
Methods inherited from class org.bouncycastle.openpgp.operator.PBEKeyEncryptionMethodGenerator
generate, getKey
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JcePBEKeyEncryptionMethodGenerator

public JcePBEKeyEncryptionMethodGenerator(char[] passPhrase,
                                          PGPDigestCalculator s2kDigestCalculator)
Create a PBE encryption method generator using the provided calculator for key calculation.

Parameters:
passPhrase - the passphrase to use as the primary source of key material.
s2kDigestCalculator - the digest calculator to use for key calculation.

JcePBEKeyEncryptionMethodGenerator

public JcePBEKeyEncryptionMethodGenerator(char[] passPhrase)
Create a PBE encryption method generator using the default SHA-1 digest calculator for key calculation.

Parameters:
passPhrase - the passphrase to use as the primary source of key material.
Method Detail

setProvider

public JcePBEKeyEncryptionMethodGenerator setProvider(java.security.Provider provider)

setProvider

public JcePBEKeyEncryptionMethodGenerator setProvider(java.lang.String providerName)

setSecureRandom

public PBEKeyEncryptionMethodGenerator setSecureRandom(java.security.SecureRandom random)
Provide a user defined source of randomness.

Overrides:
setSecureRandom in class PBEKeyEncryptionMethodGenerator
Parameters:
random - the secure random to be used.
Returns:
the current generator.

encryptSessionInfo

protected byte[] encryptSessionInfo(int encAlgorithm,
                                    byte[] key,
                                    byte[] sessionInfo)
                             throws PGPException
Specified by:
encryptSessionInfo in class PBEKeyEncryptionMethodGenerator
Throws:
PGPException

Bouncy Castle Cryptography Library 1.47