Bouncy Castle Cryptography Library 1.81

org.bouncycastle.openpgp.operator.jcajce
Class JcePublicKeyKeyEncryptionMethodGenerator

java.lang.Object
  extended byorg.bouncycastle.openpgp.operator.PublicKeyKeyEncryptionMethodGenerator
      extended byorg.bouncycastle.openpgp.operator.jcajce.JcePublicKeyKeyEncryptionMethodGenerator
All Implemented Interfaces:
PGPKeyEncryptionMethodGenerator

public class JcePublicKeyKeyEncryptionMethodGenerator
extends PublicKeyKeyEncryptionMethodGenerator


Field Summary
 
Fields inherited from class org.bouncycastle.openpgp.operator.PublicKeyKeyEncryptionMethodGenerator
SESSION_KEY_OBFUSCATION_PROPERTY, sessionKeyObfuscation, useWildcardRecipient, WILDCARD, WILDCARD_FINGERPRINT, WILDCARD_KEYID
 
Constructor Summary
JcePublicKeyKeyEncryptionMethodGenerator(PGPPublicKey key)
          Create a public key encryption method generator with the method to be based on the passed in key.
 
Method Summary
protected  byte[] encryptSessionInfo(PGPPublicKey pubKey, byte[] sessionKey, byte optSymAlgId, boolean isV3)
          Encrypt a session key using the recipients public key.
 JcePublicKeyKeyEncryptionMethodGenerator setProvider(java.security.Provider provider)
           
 JcePublicKeyKeyEncryptionMethodGenerator setProvider(java.lang.String providerName)
           
 JcePublicKeyKeyEncryptionMethodGenerator setSecureRandom(java.security.SecureRandom random)
          Provide a user defined source of randomness.
 
Methods inherited from class org.bouncycastle.openpgp.operator.PublicKeyKeyEncryptionMethodGenerator
createSessionInfo, encodeEncryptedSessionInfo, generate, getSessionInfo, setSessionKeyObfuscation, setUseWildcardKeyID, setUseWildcardRecipient
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JcePublicKeyKeyEncryptionMethodGenerator

public JcePublicKeyKeyEncryptionMethodGenerator(PGPPublicKey key)
Create a public key encryption method generator with the method to be based on the passed in key.

Parameters:
key - the public key to use for encryption.
Method Detail

setProvider

public JcePublicKeyKeyEncryptionMethodGenerator setProvider(java.security.Provider provider)

setProvider

public JcePublicKeyKeyEncryptionMethodGenerator setProvider(java.lang.String providerName)

setSecureRandom

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

Parameters:
random - the secure random to be used.
Returns:
the current generator.

encryptSessionInfo

protected byte[] encryptSessionInfo(PGPPublicKey pubKey,
                                    byte[] sessionKey,
                                    byte optSymAlgId,
                                    boolean isV3)
                             throws PGPException
Description copied from class: PublicKeyKeyEncryptionMethodGenerator
Encrypt a session key using the recipients public key.

Specified by:
encryptSessionInfo in class PublicKeyKeyEncryptionMethodGenerator
Parameters:
pubKey - recipients public key
sessionKey - session-key
optSymAlgId - for v3: session key algorithm ID; for v6: 0
Returns:
encrypted session info
Throws:
PGPException

Bouncy Castle Cryptography Library 1.81