Class JceKeyAgreeRecipient

    • Constructor Detail

      • JceKeyAgreeRecipient

        public JceKeyAgreeRecipient​(java.security.PrivateKey recipientKey)
    • Method Detail

      • setProvider

        public JceKeyAgreeRecipient setProvider​(java.security.Provider provider)
        Set the provider to use for key recovery and content processing.
        Parameters:
        provider - provider to use.
        Returns:
        this recipient.
      • setProvider

        public JceKeyAgreeRecipient setProvider​(java.lang.String providerName)
        Set the provider to use for key recovery and content processing.
        Parameters:
        providerName - the name of the provider to use.
        Returns:
        this recipient.
      • setContentProvider

        public JceKeyAgreeRecipient setContentProvider​(java.security.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 - the provider to use.
        Returns:
        this recipient.
      • setContentProvider

        public JceKeyAgreeRecipient setContentProvider​(java.lang.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 - 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 name of the provider to use.
        Returns:
        this recipient.
      • unwrapSessionKey

        protected java.security.Key unwrapSessionKey​(org.bouncycastle.asn1.ASN1ObjectIdentifier wrapAlg,
                                                     javax.crypto.SecretKey agreedKey,
                                                     org.bouncycastle.asn1.ASN1ObjectIdentifier contentEncryptionAlgorithm,
                                                     byte[] encryptedContentEncryptionKey)
                                              throws CMSException,
                                                     java.security.InvalidKeyException,
                                                     java.security.NoSuchAlgorithmException
        Throws:
        CMSException
        java.security.InvalidKeyException
        java.security.NoSuchAlgorithmException
      • extractSecretKey

        protected java.security.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