Bouncy Castle Cryptography Library 1.47

org.bouncycastle.openpgp.operator.bc
Class BcPBEKeyEncryptionMethodGenerator

java.lang.Object
  extended by org.bouncycastle.openpgp.operator.PGPKeyEncryptionMethodGenerator
      extended by org.bouncycastle.openpgp.operator.PBEKeyEncryptionMethodGenerator
          extended by org.bouncycastle.openpgp.operator.bc.BcPBEKeyEncryptionMethodGenerator

public class BcPBEKeyEncryptionMethodGenerator
extends PBEKeyEncryptionMethodGenerator

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


Constructor Summary
BcPBEKeyEncryptionMethodGenerator(char[] passPhrase)
          Create a PBE encryption method generator using the default SHA-1 digest calculator for key calculation.
BcPBEKeyEncryptionMethodGenerator(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)
           
 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

BcPBEKeyEncryptionMethodGenerator

public BcPBEKeyEncryptionMethodGenerator(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.

BcPBEKeyEncryptionMethodGenerator

public BcPBEKeyEncryptionMethodGenerator(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

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