public class JceAsymmetricKeyWrapper extends AsymmetricKeyWrapper
Constructor and Description |
---|
JceAsymmetricKeyWrapper(org.bouncycastle.asn1.x509.AlgorithmIdentifier algorithmIdentifier,
java.security.PublicKey publicKey)
Create a wrapper, overriding the algorithm type that is stored in the public key.
|
JceAsymmetricKeyWrapper(java.security.spec.AlgorithmParameterSpec algorithmParameterSpec,
java.security.PublicKey publicKey)
Create a wrapper, overriding the algorithm type that is stored in the public key.
|
JceAsymmetricKeyWrapper(java.security.AlgorithmParameters algorithmParams,
java.security.PublicKey publicKey)
Create a wrapper, overriding the algorithm type that is stored in the public key.
|
JceAsymmetricKeyWrapper(java.security.PublicKey publicKey) |
JceAsymmetricKeyWrapper(java.security.cert.X509Certificate certificate) |
Modifier and Type | Method and Description |
---|---|
byte[] |
generateWrappedKey(GenericKey encryptionKey) |
JceAsymmetricKeyWrapper |
setAlgorithmMapping(org.bouncycastle.asn1.ASN1ObjectIdentifier algorithm,
java.lang.String algorithmName)
Internally algorithm ids are converted into cipher names using a lookup table.
|
JceAsymmetricKeyWrapper |
setProvider(java.security.Provider provider) |
JceAsymmetricKeyWrapper |
setProvider(java.lang.String providerName) |
JceAsymmetricKeyWrapper |
setSecureRandom(java.security.SecureRandom random) |
getAlgorithmIdentifier
public JceAsymmetricKeyWrapper(java.security.PublicKey publicKey)
public JceAsymmetricKeyWrapper(java.security.cert.X509Certificate certificate)
public JceAsymmetricKeyWrapper(org.bouncycastle.asn1.x509.AlgorithmIdentifier algorithmIdentifier, java.security.PublicKey publicKey)
algorithmIdentifier
- identifier for encryption algorithm to be used.publicKey
- the public key to be used.public JceAsymmetricKeyWrapper(java.security.AlgorithmParameters algorithmParams, java.security.PublicKey publicKey) throws java.security.spec.InvalidParameterSpecException
algorithmParams
- algorithm parameters for encryption algorithm to be used.publicKey
- the public key to be used.java.security.spec.InvalidParameterSpecException
public JceAsymmetricKeyWrapper(java.security.spec.AlgorithmParameterSpec algorithmParameterSpec, java.security.PublicKey publicKey)
algorithmParameterSpec
- the parameterSpec for encryption algorithm to be used.publicKey
- the public key to be used.public JceAsymmetricKeyWrapper setProvider(java.security.Provider provider)
public JceAsymmetricKeyWrapper setProvider(java.lang.String providerName)
public JceAsymmetricKeyWrapper setSecureRandom(java.security.SecureRandom random)
public JceAsymmetricKeyWrapper 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 byte[] generateWrappedKey(GenericKey encryptionKey) throws OperatorException
OperatorException