Top Fields Constructors Methods
org.bouncycastle.operator.jcajce

public Class JceAsymmetricKeyWrapper

extends AsymmetricKeyWrapper
Class Inheritance
Imports
java.security.AlgorithmParameters, .GeneralSecurityException, .InvalidKeyException, .KeyPair, .KeyPairGenerator, .Provider, .ProviderException, .PublicKey, .SecureRandom, java.security.cert.X509Certificate, java.security.interfaces.ECPublicKey, java.security.spec.AlgorithmParameterSpec, .InvalidParameterSpecException, .MGF1ParameterSpec, java.util.HashMap, .HashSet, .Map, .Set, javax.crypto.Cipher, .KeyAgreement, .SecretKey, javax.crypto.spec.OAEPParameterSpec, .PSource, .SecretKeySpec, org.bouncycastle.asn1.ASN1ObjectIdentifier, .DERNull, .DEROctetString, org.bouncycastle.asn1.cryptopro.CryptoProObjectIdentifiers, .Gost2814789EncryptedKey, .GostR3410KeyTransport, .GostR3410TransportParameters, org.bouncycastle.asn1.nist.NISTObjectIdentifiers, org.bouncycastle.asn1.oiw.OIWObjectIdentifiers, org.bouncycastle.asn1.pkcs.PKCSObjectIdentifiers, .RSAESOAEPparams, org.bouncycastle.asn1.rosstandart.RosstandartObjectIdentifiers, org.bouncycastle.asn1.x509.AlgorithmIdentifier, .SubjectPublicKeyInfo, org.bouncycastle.crypto.CryptoServicesRegistrar, org.bouncycastle.jcajce.spec.GOST28147WrapParameterSpec, .UserKeyingMaterialSpec, org.bouncycastle.jcajce.util.DefaultJcaJceHelper, .NamedJcaJceHelper, .ProviderJcaJceHelper, org.bouncycastle.operator.AsymmetricKeyWrapper, .GenericKey, .OperatorException, org.bouncycastle.util.Arrays

Field Summary

Modifier and TypeField and Description
private static final Map<K, V>
private Map<K, V>
private static final Set<E>
private OperatorHelper
private PublicKey
private SecureRandom

Constructor Summary

AccessConstructor and Description
public
public
public
JceAsymmetricKeyWrapper(AlgorithmIdentifier
identifier for encryption algorithm to be used.
algorithmIdentifier
,
PublicKey
the public key to be used.
publicKey
)

Create a wrapper, overriding the algorithm type that is stored in the public key.

public
JceAsymmetricKeyWrapper(AlgorithmParameters
algorithm parameters for encryption algorithm to be used.
algorithmParams
,
PublicKey
the public key to be used.
publicKey
)

Create a wrapper, overriding the algorithm type that is stored in the public key.

public
JceAsymmetricKeyWrapper(AlgorithmParameterSpec
the parameterSpec for encryption algorithm to be used.
algorithmParameterSpec
,
PublicKey
the public key to be used.
publicKey
)

Create a wrapper, overriding the algorithm type that is stored in the public key.

Method Summary

Modifier and TypeMethod and Description
private static AlgorithmIdentifier
extractAlgID(PublicKey pubKey, AlgorithmParameterSpec algorithmParameterSpec)

public byte[]
private static AlgorithmIdentifier
getDigest(String digest)

pack-priv static boolean
public JceAsymmetricKeyWrapper

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 JceAsymmetricKeyWrapper
public JceAsymmetricKeyWrapper
setProvider(String providerName)

public JceAsymmetricKeyWrapper
Inherited from org.bouncycastle.operator.AsymmetricKeyWrapper:
getAlgorithmIdentifier

Field Detail

digestsback to summary
private static final Map<K, V> digests
extraMappingsback to summary
private Map<K, V> extraMappings
gostAlgsback to summary
private static final Set<E> gostAlgs
helperback to summary
private OperatorHelper helper
publicKeyback to summary
private PublicKey publicKey
randomback to summary
private SecureRandom random

Constructor Detail

JceAsymmetricKeyWrapperback to summary
public JceAsymmetricKeyWrapper(PublicKey publicKey)
JceAsymmetricKeyWrapperback to summary
public JceAsymmetricKeyWrapper(X509Certificate certificate)
JceAsymmetricKeyWrapperback to summary
public JceAsymmetricKeyWrapper(AlgorithmIdentifier algorithmIdentifier, PublicKey publicKey)

Create a wrapper, overriding the algorithm type that is stored in the public key.

Parameters
algorithmIdentifier:AlgorithmIdentifier

identifier for encryption algorithm to be used.

publicKey:PublicKey

the public key to be used.

JceAsymmetricKeyWrapperback to summary
public JceAsymmetricKeyWrapper(AlgorithmParameters algorithmParams, PublicKey publicKey) throws InvalidParameterSpecException

Create a wrapper, overriding the algorithm type that is stored in the public key.

Parameters
algorithmParams:AlgorithmParameters

algorithm parameters for encryption algorithm to be used.

publicKey:PublicKey

the public key to be used.

JceAsymmetricKeyWrapperback to summary
public JceAsymmetricKeyWrapper(AlgorithmParameterSpec algorithmParameterSpec, PublicKey publicKey)

Create a wrapper, overriding the algorithm type that is stored in the public key.

Parameters
algorithmParameterSpec:AlgorithmParameterSpec

the parameterSpec for encryption algorithm to be used.

publicKey:PublicKey

the public key to be used.

Method Detail

extractAlgIDback to summary
private static AlgorithmIdentifier extractAlgID(PublicKey pubKey, AlgorithmParameterSpec algorithmParameterSpec)
generateWrappedKeyback to summary
public byte[] generateWrappedKey(GenericKey encryptionKey) throws OperatorException

Implements org.bouncycastle.operator.KeyWrapper.generateWrappedKey.

getDigestback to summary
private static AlgorithmIdentifier getDigest(String digest)
isGOSTback to summary
pack-priv static boolean isGOST(ASN1ObjectIdentifier algorithm)
setAlgorithmMappingback to summary
public JceAsymmetricKeyWrapper 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:JceAsymmetricKeyWrapper

the current Wrapper.

setProviderback to summary
public JceAsymmetricKeyWrapper setProvider(Provider provider)
setProviderback to summary
public JceAsymmetricKeyWrapper setProvider(String providerName)
setSecureRandomback to summary
public JceAsymmetricKeyWrapper setSecureRandom(SecureRandom random)