Class BcDefaultTlsCredentialedDecryptor

  • All Implemented Interfaces:
    TlsCredentialedDecryptor, TlsCredentials

    public class BcDefaultTlsCredentialedDecryptor
    extends java.lang.Object
    implements TlsCredentialedDecryptor
    Credentialed class decrypting RSA encrypted secrets sent from a peer for our end of the TLS connection using the BC light-weight API.
    • Field Detail

      • privateKey

        protected org.bouncycastle.crypto.params.AsymmetricKeyParameter privateKey
    • Constructor Detail

      • BcDefaultTlsCredentialedDecryptor

        public BcDefaultTlsCredentialedDecryptor​(BcTlsCrypto crypto,
                                                 Certificate certificate,
                                                 org.bouncycastle.crypto.params.AsymmetricKeyParameter privateKey)
    • Method Detail

      • decrypt

        public TlsSecret decrypt​(TlsCryptoParameters cryptoParams,
                                 byte[] ciphertext)
                          throws java.io.IOException
        Description copied from interface: TlsCredentialedDecryptor
        Decrypt the passed in cipher text using the parameters available.
        Specified by:
        decrypt in interface TlsCredentialedDecryptor
        Parameters:
        cryptoParams - the parameters to use for the decryption.
        ciphertext - the cipher text containing the secret.
        Returns:
        a TlS secret.
        Throws:
        java.io.IOException - on a parsing or decryption error.
      • safeDecryptPreMasterSecret

        protected TlsSecret safeDecryptPreMasterSecret​(TlsCryptoParameters cryptoParams,
                                                       org.bouncycastle.crypto.params.RSAKeyParameters rsaServerPrivateKey,
                                                       byte[] encryptedPreMasterSecret)