Top Fields Constructors Methods
org.bouncycastle.cms.jcajce

pack-priv Class JceCMSKEMKeyUnwrapper

extends AsymmetricKeyUnwrapper
Class Inheritance
Imports
java.security.Key, .PrivateKey, .Provider, java.security.interfaces.RSAPrivateKey, java.util.HashMap, .Map, javax.crypto.Cipher, org.bouncycastle.asn1.ASN1ObjectIdentifier, org.bouncycastle.asn1.cms.CMSORIforKEMOtherInfo, .KEMRecipientInfo, org.bouncycastle.asn1.pkcs.PrivateKeyInfo, org.bouncycastle.asn1.x509.AlgorithmIdentifier, org.bouncycastle.jcajce.spec.KTSParameterSpec, org.bouncycastle.operator.AsymmetricKeyUnwrapper, .GenericKey, .OperatorException, org.bouncycastle.operator.jcajce.JceGenericKey, org.bouncycastle.util.Arrays

Field Summary

Modifier and TypeField and Description
private Map<K, V>
private JcaJceExtHelper
private final int
private PrivateKey
private final AlgorithmIdentifier

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public GenericKey
public int
public JceCMSKEMKeyUnwrapper

Returns:

the current Wrapper.
setAlgorithmMapping
(ASN1ObjectIdentifier
OID of algorithm in recipient.
algorithm
,
String
JCE algorithm name to use.
algorithmName
)

Internally algorithm ids are converted into cipher names using a lookup table.

public JceCMSKEMKeyUnwrapper
public JceCMSKEMKeyUnwrapper
setProvider(String providerName)

Inherited from org.bouncycastle.operator.AsymmetricKeyUnwrapper:
getAlgorithmIdentifier

Field Detail

extraMappingsback to summary
private Map<K, V> extraMappings
helperback to summary
private JcaJceExtHelper helper
kekLengthback to summary
private final int kekLength
privateKeyback to summary
private PrivateKey privateKey
symWrapAlgorithmback to summary
private final AlgorithmIdentifier symWrapAlgorithm

Constructor Detail

JceCMSKEMKeyUnwrapperback to summary
public JceCMSKEMKeyUnwrapper(AlgorithmIdentifier symWrapAlg, PrivateKey privateKey)

Method Detail

generateUnwrappedKeyback to summary
public GenericKey generateUnwrappedKey(AlgorithmIdentifier encryptionKeyAlgorithm, byte[] encryptedKey) throws OperatorException

Implements org.bouncycastle.operator.KeyUnwrapper.generateUnwrappedKey.

getKekLengthback to summary
public int getKekLength()
setAlgorithmMappingback to summary
public JceCMSKEMKeyUnwrapper setAlgorithmMapping(ASN1ObjectIdentifier algorithm, 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:ASN1ObjectIdentifier

OID of algorithm in recipient.

algorithmName:String

JCE algorithm name to use.

Returns:JceCMSKEMKeyUnwrapper

the current Wrapper.

setProviderback to summary
public JceCMSKEMKeyUnwrapper setProvider(Provider provider)
setProviderback to summary
public JceCMSKEMKeyUnwrapper setProvider(String providerName)