Top Fields Constructors Methods
org.bouncycastle.cms.jcajce

pack-priv Class JceCMSKEMKeyWrapper

extends KEMKeyWrapper
Class Inheritance
Imports
java.security.Provider, .PublicKey, .SecureRandom, java.security.interfaces.RSAPublicKey, java.util.HashMap, .Map, javax.crypto.Cipher, org.bouncycastle.asn1.ASN1ObjectIdentifier, .DERNull, org.bouncycastle.asn1.cms.CMSORIforKEMOtherInfo, org.bouncycastle.asn1.iso.ISOIECObjectIdentifiers, org.bouncycastle.asn1.nist.NISTObjectIdentifiers, org.bouncycastle.asn1.x509.AlgorithmIdentifier, .SubjectPublicKeyInfo, org.bouncycastle.asn1.x9.X9ObjectIdentifiers, org.bouncycastle.cms.KEMKeyWrapper, org.bouncycastle.jcajce.interfaces.MLKEMPublicKey, org.bouncycastle.jcajce.spec.KTSParameterSpec, .MLKEMParameterSpec, org.bouncycastle.operator.DefaultKemEncapsulationLengthProvider, .GenericKey, .KemEncapsulationLengthProvider, .OperatorException, org.bouncycastle.pqc.jcajce.interfaces.NTRUKey, org.bouncycastle.pqc.jcajce.spec.NTRUParameterSpec, org.bouncycastle.util.Arrays, .Integers

Field Summary

Modifier and TypeField and Description
private byte[]
private Map<K, V>
private JcaJceExtHelper
private AlgorithmIdentifier
private final int
private final KemEncapsulationLengthProvider
private PublicKey
private SecureRandom
private final AlgorithmIdentifier

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public byte[]
public byte[]
public AlgorithmIdentifier
public int
private int
public AlgorithmIdentifier
public JceCMSKEMKeyWrapper

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

public JceCMSKEMKeyWrapper

Field Detail

encapsulationback to summary
private byte[] encapsulation
extraMappingsback to summary
private Map<K, V> extraMappings
helperback to summary
private JcaJceExtHelper helper
kdfAlgorithmback to summary
private AlgorithmIdentifier kdfAlgorithm
kekLengthback to summary
private final int kekLength
kemEncLenProviderback to summary
private final KemEncapsulationLengthProvider kemEncLenProvider
publicKeyback to summary
private PublicKey publicKey
randomback to summary
private SecureRandom random
symWrapAlgorithmback to summary
private final AlgorithmIdentifier symWrapAlgorithm

Constructor Detail

JceCMSKEMKeyWrapperback to summary
public JceCMSKEMKeyWrapper(PublicKey publicKey, ASN1ObjectIdentifier symWrapAlg)

Method Detail

generateWrappedKeyback to summary
public byte[] generateWrappedKey(GenericKey encryptionKey) throws OperatorException

Implements org.bouncycastle.operator.KeyWrapper.generateWrappedKey.

getEncapsulationback to summary
public byte[] getEncapsulation()

Implements abstract org.bouncycastle.cms.KEMKeyWrapper.getEncapsulation.

getKdfAlgorithmIdentifierback to summary
public AlgorithmIdentifier getKdfAlgorithmIdentifier()

Implements abstract org.bouncycastle.cms.KEMKeyWrapper.getKdfAlgorithmIdentifier.

getKekLengthback to summary
public int getKekLength()

Implements abstract org.bouncycastle.cms.KEMKeyWrapper.getKekLength.

getKemEncLengthback to summary
private int getKemEncLength(PublicKey key)
getWrapAlgorithmIdentifierback to summary
public AlgorithmIdentifier getWrapAlgorithmIdentifier()

Implements abstract org.bouncycastle.cms.KEMKeyWrapper.getWrapAlgorithmIdentifier.

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

the current Wrapper.

setKDFback to summary
public JceCMSKEMKeyWrapper setKDF(AlgorithmIdentifier kdfAlgorithm)
setProviderback to summary
public JceCMSKEMKeyWrapper setProvider(Provider provider)
setProviderback to summary
public JceCMSKEMKeyWrapper setProvider(String providerName)
setSecureRandomback to summary
public JceCMSKEMKeyWrapper setSecureRandom(SecureRandom random)