Top Fields Constructors Methods
org.bouncycastle.operator.jcajce

public Class JceAsymmetricKeyUnwrapper

extends AsymmetricKeyUnwrapper
Class Inheritance
Imports
java.security.AlgorithmParameters, .GeneralSecurityException, .InvalidAlgorithmParameterException, .InvalidKeyException, .Key, .PrivateKey, .Provider, .ProviderException, java.util.HashMap, .Map, javax.crypto.BadPaddingException, .Cipher, .IllegalBlockSizeException, javax.crypto.spec.SecretKeySpec, org.bouncycastle.asn1.ASN1ObjectIdentifier, org.bouncycastle.asn1.x509.AlgorithmIdentifier, org.bouncycastle.jcajce.util.DefaultJcaJceHelper, .NamedJcaJceHelper, .ProviderJcaJceHelper, org.bouncycastle.operator.AsymmetricKeyUnwrapper, .GenericKey, .OperatorException

Field Summary

Modifier and TypeField and Description
private Map<K, V>
private OperatorHelper
private PrivateKey
private boolean

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public GenericKey
public JceAsymmetricKeyUnwrapper

Returns:

the current Unwrapper.
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 JceAsymmetricKeyUnwrapper

Returns:

this recipient.
setMustProduceEncodableUnwrappedKey
(boolean
true if getEncoded() should return key bytes, false if not necessary.
unwrappedKeyMustBeEncodable
)

Flag that unwrapping must produce a key that will return a meaningful value from a call to Key.getEncoded().

public JceAsymmetricKeyUnwrapper
public JceAsymmetricKeyUnwrapper
setProvider(String providerName)

Inherited from org.bouncycastle.operator.AsymmetricKeyUnwrapper:
getAlgorithmIdentifier

Field Detail

extraMappingsback to summary
private Map<K, V> extraMappings
helperback to summary
private OperatorHelper helper
privKeyback to summary
private PrivateKey privKey
unwrappedKeyMustBeEncodableback to summary
private boolean unwrappedKeyMustBeEncodable

Constructor Detail

JceAsymmetricKeyUnwrapperback to summary
public JceAsymmetricKeyUnwrapper(AlgorithmIdentifier algorithmIdentifier, PrivateKey privKey)

Method Detail

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

Implements org.bouncycastle.operator.KeyUnwrapper.generateUnwrappedKey.

setAlgorithmMappingback to summary
public JceAsymmetricKeyUnwrapper 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:JceAsymmetricKeyUnwrapper

the current Unwrapper.

setMustProduceEncodableUnwrappedKeyback to summary
public JceAsymmetricKeyUnwrapper setMustProduceEncodableUnwrappedKey(boolean unwrappedKeyMustBeEncodable)

Flag that unwrapping must produce a key that will return a meaningful value from a call to Key.getEncoded(). This is important if you are using a HSM for unwrapping and using a software based provider for with the unwrapped key. Default value: false.

Parameters
unwrappedKeyMustBeEncodable:boolean

true if getEncoded() should return key bytes, false if not necessary.

Returns:JceAsymmetricKeyUnwrapper

this recipient.

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