Class JceKeyAgreeRecipientInfoGenerator

    • Constructor Detail

      • JceKeyAgreeRecipientInfoGenerator

        public JceKeyAgreeRecipientInfoGenerator​(org.bouncycastle.asn1.ASN1ObjectIdentifier keyAgreementOID,
                                                 java.security.PrivateKey senderPrivateKey,
                                                 java.security.PublicKey senderPublicKey,
                                                 org.bouncycastle.asn1.ASN1ObjectIdentifier keyEncryptionOID)
    • Method Detail

      • addRecipient

        public JceKeyAgreeRecipientInfoGenerator addRecipient​(java.security.cert.X509Certificate recipientCert)
                                                       throws java.security.cert.CertificateEncodingException
        Add a recipient based on the passed in certificate's public key and its issuer and serial number.
        Parameters:
        recipientCert - recipient's certificate
        Returns:
        the current instance.
        Throws:
        java.security.cert.CertificateEncodingException - if the necessary data cannot be extracted from the certificate.
      • addRecipient

        public JceKeyAgreeRecipientInfoGenerator addRecipient​(byte[] subjectKeyID,
                                                              java.security.PublicKey publicKey)
                                                       throws java.security.cert.CertificateEncodingException
        Add a recipient identified by the passed in subjectKeyID and the for the passed in public key.
        Parameters:
        subjectKeyID - identifier actual recipient will use to match the private key.
        publicKey - the public key for encrypting the secret key.
        Returns:
        the current instance.
        Throws:
        java.security.cert.CertificateEncodingException
      • generateRecipientEncryptedKeys

        public org.bouncycastle.asn1.ASN1Sequence generateRecipientEncryptedKeys​(org.bouncycastle.asn1.x509.AlgorithmIdentifier keyAgreeAlgorithm,
                                                                                 org.bouncycastle.asn1.x509.AlgorithmIdentifier keyEncryptionAlgorithm,
                                                                                 org.bouncycastle.operator.GenericKey contentEncryptionKey)
                                                                          throws CMSException
        Specified by:
        generateRecipientEncryptedKeys in class KeyAgreeRecipientInfoGenerator
        Throws:
        CMSException