Top Fields Constructors Methods
org.bouncycastle.cms.jcajce

public abstract Class JceKeyAgreeRecipient

extends Object
implements KeyAgreeRecipient
Class Inheritance
All Implemented Interfaces
org.bouncycastle.cms.KeyAgreeRecipient, org.bouncycastle.cms.Recipient
Known Direct Subclasses
org.bouncycastle.cms.jcajce.JceKeyAgreeAuthenticatedRecipient, org.bouncycastle.cms.jcajce.JceKeyAgreeAuthEnvelopedRecipient, org.bouncycastle.cms.jcajce.JceKeyAgreeEnvelopedRecipient
Imports
java.io.IOException, java.security.GeneralSecurityException, .InvalidKeyException, .Key, .KeyFactory, .NoSuchAlgorithmException, .PrivateKey, .Provider, .PublicKey, java.security.spec.InvalidKeySpecException, .X509EncodedKeySpec, java.util.HashSet, .Set, javax.crypto.Cipher, .KeyAgreement, .NoSuchPaddingException, .SecretKey, org.bouncycastle.asn1.ASN1Encoding, .ASN1ObjectIdentifier, .ASN1OctetString, .DERNull, org.bouncycastle.asn1.cms.ecc.ECCCMSSharedInfo, .MQVuserKeyingMaterial, org.bouncycastle.asn1.cryptopro.CryptoProObjectIdentifiers, .Gost2814789EncryptedKey, .Gost2814789KeyWrapParameters, org.bouncycastle.asn1.pkcs.PrivateKeyInfo, org.bouncycastle.asn1.x509.AlgorithmIdentifier, .SubjectPublicKeyInfo, org.bouncycastle.asn1.x9.X9ObjectIdentifiers, org.bouncycastle.cms.CMSException, .KeyAgreeRecipient, org.bouncycastle.jcajce.spec.GOST28147WrapParameterSpec, .MQVParameterSpec, .UserKeyingMaterialSpec, org.bouncycastle.operator.DefaultSecretKeySizeProvider, .SecretKeySizeProvider, org.bouncycastle.util.Arrays, .Pack

Field Summary

Modifier and TypeField and Description
protected EnvelopedDataHelper
private static KeyMaterialGenerator
protected EnvelopedDataHelper
private SecretKeySizeProvider
private static KeyMaterialGenerator
private static final Set<E>
private AlgorithmIdentifier
private PrivateKey
private static KeyMaterialGenerator
protected EnvelopedDataHelper

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private SecretKey
calculateAgreedWrapKey(AlgorithmIdentifier keyEncAlg, AlgorithmIdentifier wrapAlg, PublicKey senderPublicKey, ASN1OctetString userKeyingMaterial, PrivateKey receiverPrivateKey, KeyMaterialGenerator kmGen)

protected Key
extractSecretKey(AlgorithmIdentifier keyEncryptionAlgorithm, AlgorithmIdentifier contentEncryptionAlgorithm, SubjectPublicKeyInfo senderKey, ASN1OctetString userKeyingMaterial, byte[] encryptedContentEncryptionKey)

public AlgorithmIdentifier
public JceKeyAgreeRecipient

Returns:

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

Set the provider to use for content processing.

public JceKeyAgreeRecipient

Returns:

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

Set the provider to use for content processing.

public JceKeyAgreeRecipient

Returns:

this recipient.
setPrivateKeyAlgorithmIdentifier
(AlgorithmIdentifier
the algorithm identifier for the private key.
privKeyAlgID
)

Set the algorithm identifier for the private key.

public JceKeyAgreeRecipient

Returns:

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

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

public JceKeyAgreeRecipient

Returns:

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

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

public JceKeyAgreeRecipient

Returns:

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

Set the provider to use for unwrapping the content session key.

public JceKeyAgreeRecipient

Returns:

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

Set the provider to use for unwrapping the content session key.

protected Key
unwrapSessionKey(ASN1ObjectIdentifier wrapAlg, SecretKey agreedKey, ASN1ObjectIdentifier contentEncryptionAlgorithm, byte[] encryptedContentEncryptionKey)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

contentHelperback to summary
protected EnvelopedDataHelper contentHelper
ecc_cms_Generatorback to summary
private static KeyMaterialGenerator ecc_cms_Generator
helperback to summary
protected EnvelopedDataHelper helper
keySizeProviderback to summary
private SecretKeySizeProvider keySizeProvider
old_ecc_cms_Generatorback to summary
private static KeyMaterialGenerator old_ecc_cms_Generator
possibleOldMessagesback to summary
private static final Set<E> possibleOldMessages
privKeyAlgIDback to summary
private AlgorithmIdentifier privKeyAlgID
recipientKeyback to summary
private PrivateKey recipientKey
simple_ecc_cmsGeneratorback to summary
private static KeyMaterialGenerator simple_ecc_cmsGenerator
unwrappingHelperback to summary
protected EnvelopedDataHelper unwrappingHelper

Constructor Detail

JceKeyAgreeRecipientback to summary
public JceKeyAgreeRecipient(PrivateKey recipientKey)

Method Detail

calculateAgreedWrapKeyback to summary
private SecretKey calculateAgreedWrapKey(AlgorithmIdentifier keyEncAlg, AlgorithmIdentifier wrapAlg, PublicKey senderPublicKey, ASN1OctetString userKeyingMaterial, PrivateKey receiverPrivateKey, KeyMaterialGenerator kmGen) throws CMSException, GeneralSecurityException, IOException
extractSecretKeyback to summary
protected Key extractSecretKey(AlgorithmIdentifier keyEncryptionAlgorithm, AlgorithmIdentifier contentEncryptionAlgorithm, SubjectPublicKeyInfo senderKey, ASN1OctetString userKeyingMaterial, byte[] encryptedContentEncryptionKey) throws CMSException
getPrivateKeyAlgorithmIdentifierback to summary
public AlgorithmIdentifier getPrivateKeyAlgorithmIdentifier()

Implements org.bouncycastle.cms.KeyAgreeRecipient.getPrivateKeyAlgorithmIdentifier.

setContentProviderback to summary
public JceKeyAgreeRecipient 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:JceKeyAgreeRecipient

this recipient.

setContentProviderback to summary
public JceKeyAgreeRecipient 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:JceKeyAgreeRecipient

this recipient.

setPrivateKeyAlgorithmIdentifierback to summary
public JceKeyAgreeRecipient setPrivateKeyAlgorithmIdentifier(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:AlgorithmIdentifier

the algorithm identifier for the private key.

Returns:JceKeyAgreeRecipient

this recipient.

setProviderback to summary
public JceKeyAgreeRecipient setProvider(Provider provider)

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

Parameters
provider:Provider

provider to use.

Returns:JceKeyAgreeRecipient

this recipient.

setProviderback to summary
public JceKeyAgreeRecipient 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:JceKeyAgreeRecipient

this recipient.

setUnwrappingProviderback to summary
public JceKeyAgreeRecipient setUnwrappingProvider(Provider provider)

Set the provider to use for unwrapping the content session key.

Parameters
provider:Provider

provider to use.

Returns:JceKeyAgreeRecipient

this recipient.

setUnwrappingProviderback to summary
public JceKeyAgreeRecipient setUnwrappingProvider(String providerName)

Set the provider to use for unwrapping the content session key.

Parameters
providerName:String

the name of the provider to use.

Returns:JceKeyAgreeRecipient

this recipient.

unwrapSessionKeyback to summary
protected Key unwrapSessionKey(ASN1ObjectIdentifier wrapAlg, SecretKey agreedKey, ASN1ObjectIdentifier contentEncryptionAlgorithm, byte[] encryptedContentEncryptionKey) throws CMSException, InvalidKeyException, NoSuchAlgorithmException