Top Fields Constructors Methods
org.bouncycastle.cms.jcajce

public Class JceKeyAgreeRecipientInfoGenerator

extends KeyAgreeRecipientInfoGenerator
Class Inheritance
Imports
java.io.IOException, java.security.AlgorithmParameters, .GeneralSecurityException, .KeyPair, .KeyPairGenerator, .PrivateKey, .Provider, .PublicKey, .SecureRandom, java.security.cert.CertificateEncodingException, .X509Certificate, java.security.spec.AlgorithmParameterSpec, java.util.ArrayList, .List, javax.crypto.Cipher, .KeyAgreement, .SecretKey, org.bouncycastle.asn1.ASN1EncodableVector, .ASN1ObjectIdentifier, .ASN1OctetString, .ASN1Sequence, .DEROctetString, .DERSequence, org.bouncycastle.asn1.cms.KeyAgreeRecipientIdentifier, .OriginatorPublicKey, .RecipientEncryptedKey, .RecipientKeyIdentifier, org.bouncycastle.asn1.cms.ecc.MQVuserKeyingMaterial, org.bouncycastle.asn1.pkcs.PKCSObjectIdentifiers, org.bouncycastle.asn1.x509.AlgorithmIdentifier, .SubjectPublicKeyInfo, org.bouncycastle.cms.CMSException, .KeyAgreeRecipientInfoGenerator, org.bouncycastle.jcajce.spec.MQVParameterSpec, .UserKeyingMaterialSpec, org.bouncycastle.operator.DefaultSecretKeySizeProvider, .GenericKey, .SecretKeySizeProvider, org.bouncycastle.util.Arrays

Field Summary

Modifier and TypeField and Description
private static KeyMaterialGenerator
private KeyPair
private EnvelopedDataHelper
private SecretKeySizeProvider
private SecureRandom
private List<E>
private List<E>
private PrivateKey
private PublicKey
private byte[]

Constructor Summary

AccessConstructor and Description
public
JceKeyAgreeRecipientInfoGenerator(ASN1ObjectIdentifier keyAgreementOID, PrivateKey senderPrivateKey, PublicKey senderPublicKey, ASN1ObjectIdentifier keyEncryptionOID)

Method Summary

Modifier and TypeMethod and Description
public JceKeyAgreeRecipientInfoGenerator

Returns:

the current instance.
addRecipient
(X509Certificate
recipient's certificate
recipientCert
)

Add a recipient based on the passed in certificate's public key and its issuer and serial number.

public JceKeyAgreeRecipientInfoGenerator

Returns:

the current instance.
addRecipient
(byte[]
identifier actual recipient will use to match the private key.
subjectKeyID
,
PublicKey
the public key for encrypting the secret key.
publicKey
)

Add a recipient identified by the passed in subjectKeyID and the for the passed in public key.

public ASN1Sequence
protected byte[]
private void
init(ASN1ObjectIdentifier keyAgreementOID)

public JceKeyAgreeRecipientInfoGenerator
public JceKeyAgreeRecipientInfoGenerator
setProvider(String providerName)

public JceKeyAgreeRecipientInfoGenerator
public JceKeyAgreeRecipientInfoGenerator
setUserKeyingMaterial(byte[] userKeyingMaterial)

Inherited from org.bouncycastle.cms.KeyAgreeRecipientInfoGenerator:
createOriginatorPublicKeygenerate

Field Detail

ecc_cms_Generatorback to summary
private static KeyMaterialGenerator ecc_cms_Generator
ephemeralKPback to summary
private KeyPair ephemeralKP
helperback to summary
private EnvelopedDataHelper helper
keySizeProviderback to summary
private SecretKeySizeProvider keySizeProvider
randomback to summary
private SecureRandom random
recipientIDsback to summary
private List<E> recipientIDs
recipientKeysback to summary
private List<E> recipientKeys
senderPrivateKeyback to summary
private PrivateKey senderPrivateKey
senderPublicKeyback to summary
private PublicKey senderPublicKey
userKeyingMaterialback to summary
private byte[] userKeyingMaterial

Constructor Detail

JceKeyAgreeRecipientInfoGeneratorback to summary
public JceKeyAgreeRecipientInfoGenerator(ASN1ObjectIdentifier keyAgreementOID, PrivateKey senderPrivateKey, PublicKey senderPublicKey, ASN1ObjectIdentifier keyEncryptionOID)

Method Detail

addRecipientback to summary
public JceKeyAgreeRecipientInfoGenerator addRecipient(X509Certificate recipientCert) throws CertificateEncodingException

Add a recipient based on the passed in certificate's public key and its issuer and serial number.

Parameters
recipientCert:X509Certificate

recipient's certificate

Returns:JceKeyAgreeRecipientInfoGenerator

the current instance.

Exceptions
CertificateEncodingException:
if the necessary data cannot be extracted from the certificate.
addRecipientback to summary
public JceKeyAgreeRecipientInfoGenerator addRecipient(byte[] subjectKeyID, PublicKey publicKey) throws CertificateEncodingException

Add a recipient identified by the passed in subjectKeyID and the for the passed in public key.

Parameters
subjectKeyID:byte[]

identifier actual recipient will use to match the private key.

publicKey:PublicKey

the public key for encrypting the secret key.

Returns:JceKeyAgreeRecipientInfoGenerator

the current instance.

generateRecipientEncryptedKeysback to summary
public ASN1Sequence generateRecipientEncryptedKeys(AlgorithmIdentifier keyAgreeAlgorithm, AlgorithmIdentifier keyEncryptionAlgorithm, GenericKey contentEncryptionKey) throws CMSException

Implements abstract org.bouncycastle.cms.KeyAgreeRecipientInfoGenerator.generateRecipientEncryptedKeys.

getUserKeyingMaterialback to summary
protected byte[] getUserKeyingMaterial(AlgorithmIdentifier keyAgreeAlg) throws CMSException

Implements abstract org.bouncycastle.cms.KeyAgreeRecipientInfoGenerator.getUserKeyingMaterial.

initback to summary
private void init(ASN1ObjectIdentifier keyAgreementOID) throws CMSException
setProviderback to summary
public JceKeyAgreeRecipientInfoGenerator setProvider(Provider provider)
setProviderback to summary
public JceKeyAgreeRecipientInfoGenerator setProvider(String providerName)
setSecureRandomback to summary
public JceKeyAgreeRecipientInfoGenerator setSecureRandom(SecureRandom random)
setUserKeyingMaterialback to summary
public JceKeyAgreeRecipientInfoGenerator setUserKeyingMaterial(byte[] userKeyingMaterial)