JceAsymmetricKeyUnwrapper (Bouncy Castle Library 1.52 API Specification)
Date: 2015-03-01

org.bouncycastle.operator.jcajce

## Class JceAsymmetricKeyUnwrapper

- java.lang.Object
- - org.bouncycastle.operator.AsymmetricKeyUnwrapper
  - - org.bouncycastle.operator.jcajce.JceAsymmetricKeyUnwrapper

- All Implemented Interfaces:
    KeyUnwrapper

      public class JceAsymmetricKeyUnwrapper
      extends AsymmetricKeyUnwrapper

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `JceAsymmetricKeyUnwrapper(org.bouncycastle.asn1.x509.AlgorithmIdentifier algorithmIdentifier, java.security.PrivateKey privKey)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `GenericKey` | `generateUnwrappedKey(org.bouncycastle.asn1.x509.AlgorithmIdentifier encryptedKeyAlgorithm, byte[] encryptedKey)`
    `JceAsymmetricKeyUnwrapper` | `setAlgorithmMapping(org.bouncycastle.asn1.ASN1ObjectIdentifier algorithm, java.lang.String algorithmName)` Internally algorithm ids are converted into cipher names using a lookup table.
    `JceAsymmetricKeyUnwrapper` | `setProvider(java.security.Provider provider)`
    `JceAsymmetricKeyUnwrapper` | `setProvider(java.lang.String providerName)`

    - ### Methods inherited from class org.bouncycastle.operator.AsymmetricKeyUnwrapper

      `getAlgorithmIdentifier`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### JceAsymmetricKeyUnwrapper

          public JceAsymmetricKeyUnwrapper(org.bouncycastle.asn1.x509.AlgorithmIdentifier algorithmIdentifier,
                                   java.security.PrivateKey privKey)

  - ### Method Detail

    - #### setProvider

          public JceAsymmetricKeyUnwrapper setProvider(java.security.Provider provider)

    - #### setProvider

          public JceAsymmetricKeyUnwrapper setProvider(java.lang.String providerName)

    - #### setAlgorithmMapping

          public JceAsymmetricKeyUnwrapper 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 Unwrapper.

    - #### generateUnwrappedKey

          public GenericKey generateUnwrappedKey(org.bouncycastle.asn1.x509.AlgorithmIdentifier encryptedKeyAlgorithm,
                                        byte[] encryptedKey)
                                          throws OperatorException

      Throws:
        `OperatorException`