Class BcKeyTransRecipient
java.lang.Object
org.bouncycastle.cms.AbstractRecipient
org.bouncycastle.cms.bc.BcKeyTransRecipient
- All Implemented Interfaces:
KeyTransRecipient, Recipient
- Direct Known Subclasses:
BcRSAKeyTransEnvelopedRecipient
-
Constructor Summary
ConstructorsConstructorDescriptionBcKeyTransRecipient(org.bouncycastle.crypto.params.AsymmetricKeyParameter recipientKey) -
Method Summary
Modifier and TypeMethodDescriptionprotected org.bouncycastle.crypto.CipherParametersextractSecretKey(org.bouncycastle.asn1.x509.AlgorithmIdentifier keyEncryptionAlgorithm, org.bouncycastle.asn1.x509.AlgorithmIdentifier encryptedKeyAlgorithm, byte[] encryptedEncryptionKey) setAllowedContentAlgorithms(Set<org.bouncycastle.asn1.ASN1ObjectIdentifier> allowedContentAlgorithms) Set the content-encryption algorithms this recipient is willing to unwrap a key for.Methods inherited from class AbstractRecipient
checkContentAlgorithm, checkTagSize, isContentAlgorithmAllowed, setAllowedContentAlgorithmSet, setMinimumTagSizeInBitsMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface KeyTransRecipient
getRecipientOperator
-
Constructor Details
-
BcKeyTransRecipient
public BcKeyTransRecipient(org.bouncycastle.crypto.params.AsymmetricKeyParameter recipientKey)
-
-
Method Details
-
setAllowedContentAlgorithms
public BcKeyTransRecipient setAllowedContentAlgorithms(Set<org.bouncycastle.asn1.ASN1ObjectIdentifier> allowedContentAlgorithms) Set the content-encryption algorithms this recipient is willing to unwrap a key for. When set, an attempt to recover content protected under any other algorithm is rejected, mitigating an attacker substituting a weaker content-encryption algorithm into the recipient info.- Parameters:
allowedContentAlgorithms- the set of permitted content-encryption algorithm OIDs.- Returns:
- this recipient.
-
extractSecretKey
protected org.bouncycastle.crypto.CipherParameters extractSecretKey(org.bouncycastle.asn1.x509.AlgorithmIdentifier keyEncryptionAlgorithm, org.bouncycastle.asn1.x509.AlgorithmIdentifier encryptedKeyAlgorithm, byte[] encryptedEncryptionKey) throws CMSException - Throws:
CMSException
-