public class JceAsymmetricKeyUnwrapper extends AsymmetricKeyUnwrapper
Constructor and Description |
---|
JceAsymmetricKeyUnwrapper(org.bouncycastle.asn1.x509.AlgorithmIdentifier algorithmIdentifier,
java.security.PrivateKey privKey) |
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 |
setMustProduceEncodableUnwrappedKey(boolean unwrappedKeyMustBeEncodable)
Flag that unwrapping must produce a key that will return a meaningful value from a call to Key.getEncoded().
|
JceAsymmetricKeyUnwrapper |
setProvider(java.security.Provider provider) |
JceAsymmetricKeyUnwrapper |
setProvider(java.lang.String providerName) |
getAlgorithmIdentifier
public JceAsymmetricKeyUnwrapper(org.bouncycastle.asn1.x509.AlgorithmIdentifier algorithmIdentifier, java.security.PrivateKey privKey)
public JceAsymmetricKeyUnwrapper setProvider(java.security.Provider provider)
public JceAsymmetricKeyUnwrapper setProvider(java.lang.String providerName)
public JceAsymmetricKeyUnwrapper setMustProduceEncodableUnwrappedKey(boolean unwrappedKeyMustBeEncodable)
unwrappedKeyMustBeEncodable
- true if getEncoded() should return key bytes, false if not necessary.public JceAsymmetricKeyUnwrapper setAlgorithmMapping(org.bouncycastle.asn1.ASN1ObjectIdentifier algorithm, java.lang.String algorithmName)
For example:
unwrapper.setAlgorithmMapping(PKCSObjectIdentifiers.rsaEncryption, "RSA");
algorithm
- OID of algorithm in recipient.algorithmName
- JCE algorithm name to use.public GenericKey generateUnwrappedKey(org.bouncycastle.asn1.x509.AlgorithmIdentifier encryptedKeyAlgorithm, byte[] encryptedKey) throws OperatorException
OperatorException