Package org.bouncycastle.cms.jcajce
Class JceKeyAgreeRecipient
java.lang.Object
org.bouncycastle.cms.jcajce.JceKeyAgreeRecipient
- All Implemented Interfaces:
KeyAgreeRecipient
,Recipient
- Direct Known Subclasses:
JceKeyAgreeAuthenticatedRecipient
,JceKeyAgreeEnvelopedRecipient
-
Field Summary
Modifier and TypeFieldDescriptionprotected EnvelopedDataHelper
protected EnvelopedDataHelper
protected EnvelopedDataHelper
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected Key
extractSecretKey
(org.bouncycastle.asn1.x509.AlgorithmIdentifier keyEncryptionAlgorithm, org.bouncycastle.asn1.x509.AlgorithmIdentifier contentEncryptionAlgorithm, org.bouncycastle.asn1.x509.SubjectPublicKeyInfo senderKey, org.bouncycastle.asn1.ASN1OctetString userKeyingMaterial, byte[] encryptedContentEncryptionKey) org.bouncycastle.asn1.x509.AlgorithmIdentifier
setContentProvider
(String providerName) Set the provider to use for content processing.setContentProvider
(Provider provider) Set the provider to use for content processing.setPrivateKeyAlgorithmIdentifier
(org.bouncycastle.asn1.x509.AlgorithmIdentifier privKeyAlgID) Set the algorithm identifier for the private key.setProvider
(String providerName) Set the provider to use for key recovery and content processing.setProvider
(Provider provider) Set the provider to use for key recovery and content processing.setUnwrappingProvider
(String providerName) Set the provider to use for unwrapping the content session key.setUnwrappingProvider
(Provider provider) Set the provider to use for unwrapping the content session key.protected Key
unwrapSessionKey
(org.bouncycastle.asn1.ASN1ObjectIdentifier wrapAlg, SecretKey agreedKey, org.bouncycastle.asn1.ASN1ObjectIdentifier contentEncryptionAlgorithm, byte[] encryptedContentEncryptionKey) 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.KeyAgreeRecipient
getRecipientOperator
-
Field Details
-
helper
-
contentHelper
-
unwrappingHelper
-
-
Constructor Details
-
JceKeyAgreeRecipient
-
-
Method Details
-
setProvider
Set the provider to use for key recovery and content processing.- Parameters:
provider
- provider to use.- Returns:
- this recipient.
-
setProvider
Set the provider to use for key recovery and content processing.- Parameters:
providerName
- the name of the provider to use.- Returns:
- this recipient.
-
setUnwrappingProvider
Set the provider to use for unwrapping the content session key.- Parameters:
provider
- provider to use.- Returns:
- this recipient.
-
setUnwrappingProvider
Set the provider to use for unwrapping the content session key.- Parameters:
providerName
- the name of the provider to use.- Returns:
- this recipient.
-
setContentProvider
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
- the provider to use.- Returns:
- this recipient.
-
setContentProvider
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
- the name of the provider to use.- Returns:
- this recipient.
-
setPrivateKeyAlgorithmIdentifier
public JceKeyAgreeRecipient setPrivateKeyAlgorithmIdentifier(org.bouncycastle.asn1.x509.AlgorithmIdentifier privKeyAlgID) Set the algorithm identifier for the private key. You'll want to use this if you are dealing with a HSM and it is not possible to get the encoding of the private key.- Parameters:
privKeyAlgID
- the algorithm identifier for the private key.- Returns:
- this recipient.
-
unwrapSessionKey
protected Key unwrapSessionKey(org.bouncycastle.asn1.ASN1ObjectIdentifier wrapAlg, SecretKey agreedKey, org.bouncycastle.asn1.ASN1ObjectIdentifier contentEncryptionAlgorithm, byte[] encryptedContentEncryptionKey) throws CMSException, InvalidKeyException, NoSuchAlgorithmException -
extractSecretKey
protected Key extractSecretKey(org.bouncycastle.asn1.x509.AlgorithmIdentifier keyEncryptionAlgorithm, org.bouncycastle.asn1.x509.AlgorithmIdentifier contentEncryptionAlgorithm, org.bouncycastle.asn1.x509.SubjectPublicKeyInfo senderKey, org.bouncycastle.asn1.ASN1OctetString userKeyingMaterial, byte[] encryptedContentEncryptionKey) throws CMSException - Throws:
CMSException
-
getPrivateKeyAlgorithmIdentifier
public org.bouncycastle.asn1.x509.AlgorithmIdentifier getPrivateKeyAlgorithmIdentifier()- Specified by:
getPrivateKeyAlgorithmIdentifier
in interfaceKeyAgreeRecipient
-