Top Fields Constructors Methods
org.bouncycastle.cms.jcajce

public abstract Class JceKTSKeyTransRecipient

extends Object
implements KeyTransRecipient
Class Inheritance
All Implemented Interfaces
org.bouncycastle.cms.KeyTransRecipient, org.bouncycastle.cms.Recipient
Known Direct Subclasses
org.bouncycastle.cms.jcajce.JceKTSKeyTransAuthenticatedRecipient, org.bouncycastle.cms.jcajce.JceKTSKeyTransEnvelopedRecipient
Imports
java.io.IOException, java.security.Key, .PrivateKey, .Provider, java.util.HashMap, .Map, org.bouncycastle.asn1.ASN1Encoding, .ASN1ObjectIdentifier, .DEROctetString, org.bouncycastle.asn1.cms.IssuerAndSerialNumber, org.bouncycastle.asn1.x509.AlgorithmIdentifier, org.bouncycastle.cms.CMSException, .KeyTransRecipient, .KeyTransRecipientId, org.bouncycastle.operator.OperatorException, org.bouncycastle.operator.jcajce.JceKTSKeyUnwrapper, org.bouncycastle.util.encoders.Hex

Field Summary

Modifier and TypeField and Description
private static final byte[]
protected EnvelopedDataHelper
protected Map<K, V>
protected EnvelopedDataHelper
private final byte[]
private PrivateKey
protected boolean
protected boolean

Constructor Summary

AccessConstructor and Description
public
JceKTSKeyTransRecipient(PrivateKey recipientKey, byte[] partyVInfo)

Method Summary

Modifier and TypeMethod and Description
protected Key
extractSecretKey(AlgorithmIdentifier keyEncryptionAlgorithm, AlgorithmIdentifier encryptedKeyAlgorithm, byte[] encryptedEncryptionKey)

protected static byte[]
public JceKTSKeyTransRecipient

Returns:

the current Recipient.
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 JceKTSKeyTransRecipient

Returns:

this recipient.
setContentProvider
(Provider
the provider to use.
provider
)

Set the provider to use for content processing.

public JceKTSKeyTransRecipient

Returns:

this recipient.
setContentProvider
(String
the name of the provider to use.
providerName
)

Set the provider to use for content processing.

public JceKTSKeyTransRecipient

Returns:

this recipient.
setKeySizeValidation
(boolean
true if unwrapped key's should be validated against the content encryption algorithm, false otherwise.
doValidate
)

Set validation of retrieved key sizes against the algorithm parameters for the encrypted key where possible - default is off.

public JceKTSKeyTransRecipient

Returns:

this recipient.
setProvider
(Provider
provider to use.
provider
)

Set the provider to use for key recovery and content processing.

public JceKTSKeyTransRecipient

Returns:

this recipient.
setProvider
(String
the name of the provider to use.
providerName
)

Set the provider to use for key recovery and content processing.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ANONYMOUS_SENDERback to summary
private static final byte[] ANONYMOUS_SENDER
contentHelperback to summary
protected EnvelopedDataHelper contentHelper
extraMappingsback to summary
protected Map<K, V> extraMappings
helperback to summary
protected EnvelopedDataHelper helper
partyVInfoback to summary
private final byte[] partyVInfo
recipientKeyback to summary
private PrivateKey recipientKey
unwrappedKeyMustBeEncodableback to summary
protected boolean unwrappedKeyMustBeEncodable
validateKeySizeback to summary
protected boolean validateKeySize

Constructor Detail

JceKTSKeyTransRecipientback to summary
public JceKTSKeyTransRecipient(PrivateKey recipientKey, byte[] partyVInfo)

Method Detail

extractSecretKeyback to summary
protected Key extractSecretKey(AlgorithmIdentifier keyEncryptionAlgorithm, AlgorithmIdentifier encryptedKeyAlgorithm, byte[] encryptedEncryptionKey) throws CMSException
getPartyVInfoFromRIDback to summary
protected static byte[] getPartyVInfoFromRID(KeyTransRecipientId recipientId) throws IOException
setAlgorithmMappingback to summary
public JceKTSKeyTransRecipient 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:JceKTSKeyTransRecipient

the current Recipient.

setContentProviderback to summary
public JceKTSKeyTransRecipient setContentProvider(Provider provider)

Set the provider to use for content processing. If providerName is null a "no provider" search will be used to satisfy getInstance calls.

Parameters
provider:Provider

the provider to use.

Returns:JceKTSKeyTransRecipient

this recipient.

setContentProviderback to summary
public JceKTSKeyTransRecipient setContentProvider(String providerName)

Set the provider to use for content processing. If providerName is null a "no provider" search will be used to satisfy getInstance calls.

Parameters
providerName:String

the name of the provider to use.

Returns:JceKTSKeyTransRecipient

this recipient.

setKeySizeValidationback to summary
public JceKTSKeyTransRecipient setKeySizeValidation(boolean doValidate)

Set validation of retrieved key sizes against the algorithm parameters for the encrypted key where possible - default is off.

This setting will not have any affect if the encryption algorithm in the recipient does not specify a particular key size, or if the unwrapper is a HSM and the byte encoding of the unwrapped secret key is not available.

Parameters
doValidate:boolean

true if unwrapped key's should be validated against the content encryption algorithm, false otherwise.

Returns:JceKTSKeyTransRecipient

this recipient.

setProviderback to summary
public JceKTSKeyTransRecipient setProvider(Provider provider)

Set the provider to use for key recovery and content processing.

Parameters
provider:Provider

provider to use.

Returns:JceKTSKeyTransRecipient

this recipient.

setProviderback to summary
public JceKTSKeyTransRecipient setProvider(String providerName)

Set the provider to use for key recovery and content processing.

Parameters
providerName:String

the name of the provider to use.

Returns:JceKTSKeyTransRecipient

this recipient.