Package org.bouncycastle.cms.jcajce
Class JceKEKRecipient
- java.lang.Object
-
- org.bouncycastle.cms.jcajce.JceKEKRecipient
-
- All Implemented Interfaces:
KEKRecipient,Recipient
- Direct Known Subclasses:
JceKEKAuthenticatedRecipient,JceKEKEnvelopedRecipient
public abstract class JceKEKRecipient extends java.lang.Object implements KEKRecipient
-
-
Field Summary
Fields Modifier and Type Field Description protected EnvelopedDataHelpercontentHelperprotected EnvelopedDataHelperhelperprotected booleanvalidateKeySize
-
Constructor Summary
Constructors Constructor Description JceKEKRecipient(javax.crypto.SecretKey recipientKey)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.security.KeyextractSecretKey(org.bouncycastle.asn1.x509.AlgorithmIdentifier keyEncryptionAlgorithm, org.bouncycastle.asn1.x509.AlgorithmIdentifier encryptedKeyAlgorithm, byte[] encryptedContentEncryptionKey)JceKEKRecipientsetContentProvider(java.lang.String providerName)Set the provider to use for content processing.JceKEKRecipientsetContentProvider(java.security.Provider provider)Set the provider to use for content processing.JceKEKRecipientsetKeySizeValidation(boolean doValidate)Set validation of retrieved key sizes against the algorithm parameters for the encrypted key where possible - default is off.JceKEKRecipientsetProvider(java.lang.String providerName)Set the provider to use for key recovery and content processing.JceKEKRecipientsetProvider(java.security.Provider provider)Set the provider to use for key recovery and content processing.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.bouncycastle.cms.KEKRecipient
getRecipientOperator
-
-
-
-
Field Detail
-
helper
protected EnvelopedDataHelper helper
-
contentHelper
protected EnvelopedDataHelper contentHelper
-
validateKeySize
protected boolean validateKeySize
-
-
Method Detail
-
setProvider
public JceKEKRecipient setProvider(java.security.Provider provider)
Set the provider to use for key recovery and content processing.- Parameters:
provider- provider to use.- Returns:
- this recipient.
-
setProvider
public JceKEKRecipient setProvider(java.lang.String providerName)
Set the provider to use for key recovery and content processing.- Parameters:
providerName- the name of the provider to use.- Returns:
- this recipient.
-
setContentProvider
public JceKEKRecipient setContentProvider(java.security.Provider provider)
Set the provider to use for content processing.- Parameters:
provider- the provider to use.- Returns:
- this recipient.
-
setContentProvider
public JceKEKRecipient setContentProvider(java.lang.String providerName)
Set the provider to use for content processing.- Parameters:
providerName- the name of the provider to use.- Returns:
- this recipient.
-
setKeySizeValidation
public JceKEKRecipient 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- true if unwrapped key's should be validated against the content encryption algorithm, false otherwise.- Returns:
- this recipient.
-
extractSecretKey
protected java.security.Key extractSecretKey(org.bouncycastle.asn1.x509.AlgorithmIdentifier keyEncryptionAlgorithm, org.bouncycastle.asn1.x509.AlgorithmIdentifier encryptedKeyAlgorithm, byte[] encryptedContentEncryptionKey) throws CMSException- Throws:
CMSException
-
-