Bouncy Castle Cryptography Library 1.49

org.bouncycastle.operator.jcajce
Class JceAsymmetricKeyWrapper

java.lang.Object
  extended by org.bouncycastle.operator.AsymmetricKeyWrapper
      extended by org.bouncycastle.operator.jcajce.JceAsymmetricKeyWrapper
All Implemented Interfaces:
KeyWrapper

public class JceAsymmetricKeyWrapper
extends AsymmetricKeyWrapper


Constructor Summary
JceAsymmetricKeyWrapper(java.security.PublicKey publicKey)
           
JceAsymmetricKeyWrapper(java.security.cert.X509Certificate certificate)
           
 
Method Summary
 byte[] generateWrappedKey(GenericKey encryptionKey)
           
 JceAsymmetricKeyWrapper setAlgorithmMapping(org.bouncycastle.asn1.ASN1ObjectIdentifier algorithm, java.lang.String algorithmName)
          Internally algorithm ids are converted into cipher names using a lookup table.
 JceAsymmetricKeyWrapper setProvider(java.security.Provider provider)
           
 JceAsymmetricKeyWrapper setProvider(java.lang.String providerName)
           
 JceAsymmetricKeyWrapper setSecureRandom(java.security.SecureRandom random)
           
 
Methods inherited from class org.bouncycastle.operator.AsymmetricKeyWrapper
getAlgorithmIdentifier
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JceAsymmetricKeyWrapper

public JceAsymmetricKeyWrapper(java.security.PublicKey publicKey)

JceAsymmetricKeyWrapper

public JceAsymmetricKeyWrapper(java.security.cert.X509Certificate certificate)
Method Detail

setProvider

public JceAsymmetricKeyWrapper setProvider(java.security.Provider provider)

setProvider

public JceAsymmetricKeyWrapper setProvider(java.lang.String providerName)

setSecureRandom

public JceAsymmetricKeyWrapper setSecureRandom(java.security.SecureRandom random)

setAlgorithmMapping

public JceAsymmetricKeyWrapper setAlgorithmMapping(org.bouncycastle.asn1.ASN1ObjectIdentifier algorithm,
                                                   java.lang.String algorithmName)
Internally algorithm ids are converted into cipher names using a lookup table. For some providers the standard lookup table won't work. Use this method to establish a specific mapping from an algorithm identifier to a specific algorithm.

For example:

     unwrapper.setAlgorithmMapping(PKCSObjectIdentifiers.rsaEncryption, "RSA");
 

Parameters:
algorithm - OID of algorithm in recipient.
algorithmName - JCE algorithm name to use.
Returns:
the current Wrapper.

generateWrappedKey

public byte[] generateWrappedKey(GenericKey encryptionKey)
                          throws OperatorException
Throws:
OperatorException

Bouncy Castle Cryptography Library 1.49