public class JceAsymmetricKeyWrapper extends AsymmetricKeyWrapper
Constructor and Description |
---|
JceAsymmetricKeyWrapper(AlgorithmIdentifier algorithmIdentifier,
PublicKey publicKey)
Create a wrapper, overriding the algorithm type that is stored in the public key.
|
JceAsymmetricKeyWrapper(AlgorithmParameterSpec algorithmParameterSpec,
PublicKey publicKey)
Create a wrapper, overriding the algorithm type that is stored in the public key.
|
JceAsymmetricKeyWrapper(AlgorithmParameters algorithmParams,
PublicKey publicKey)
Create a wrapper, overriding the algorithm type that is stored in the public key.
|
JceAsymmetricKeyWrapper(PublicKey publicKey) |
JceAsymmetricKeyWrapper(X509Certificate certificate) |
Modifier and Type | Method and Description |
---|---|
byte[] |
generateWrappedKey(GenericKey encryptionKey) |
JceAsymmetricKeyWrapper |
setAlgorithmMapping(ASN1ObjectIdentifier algorithm,
String algorithmName)
Internally algorithm ids are converted into cipher names using a lookup table.
|
JceAsymmetricKeyWrapper |
setProvider(Provider provider) |
JceAsymmetricKeyWrapper |
setProvider(String providerName) |
JceAsymmetricKeyWrapper |
setSecureRandom(SecureRandom random) |
getAlgorithmIdentifier
public JceAsymmetricKeyWrapper(PublicKey publicKey)
public JceAsymmetricKeyWrapper(X509Certificate certificate)
public JceAsymmetricKeyWrapper(AlgorithmIdentifier algorithmIdentifier, PublicKey publicKey)
algorithmIdentifier
- identifier for encryption algorithm to be used.publicKey
- the public key to be used.public JceAsymmetricKeyWrapper(AlgorithmParameters algorithmParams, PublicKey publicKey) throws InvalidParameterSpecException
algorithmParams
- algorithm parameters for encryption algorithm to be used.publicKey
- the public key to be used.InvalidParameterSpecException
public JceAsymmetricKeyWrapper(AlgorithmParameterSpec algorithmParameterSpec, PublicKey publicKey)
algorithmParameterSpec
- the parameterSpec for encryption algorithm to be used.publicKey
- the public key to be used.public JceAsymmetricKeyWrapper setProvider(Provider provider)
public JceAsymmetricKeyWrapper setProvider(String providerName)
public JceAsymmetricKeyWrapper setSecureRandom(SecureRandom random)
public JceAsymmetricKeyWrapper setAlgorithmMapping(ASN1ObjectIdentifier algorithm, String algorithmName)
For example:
unwrapper.setAlgorithmMapping(PKCSObjectIdentifiers.rsaEncryption, "RSA");
algorithm
- OID of algorithm in recipient.algorithmName
- JCE algorithm name to use.public byte[] generateWrappedKey(GenericKey encryptionKey) throws OperatorException
OperatorException
Copyright © 2021 BouncyCastle.org. All rights reserved.