Class JceDefaultTlsCredentialedDecryptor
- java.lang.Object
-
- org.bouncycastle.tls.crypto.impl.jcajce.JceDefaultTlsCredentialedDecryptor
-
- All Implemented Interfaces:
TlsCredentialedDecryptor
,TlsCredentials
public class JceDefaultTlsCredentialedDecryptor 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 JCE.
-
-
Field Summary
Fields Modifier and Type Field Description protected Certificate
certificate
protected JcaTlsCrypto
crypto
protected java.security.PrivateKey
privateKey
-
Constructor Summary
Constructors Constructor Description JceDefaultTlsCredentialedDecryptor(JcaTlsCrypto crypto, Certificate certificate, java.security.PrivateKey privateKey)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TlsSecret
decrypt(TlsCryptoParameters cryptoParams, byte[] ciphertext)
Decrypt the passed in cipher text using the parameters available.Certificate
getCertificate()
Return the certificate structure representing our identity.protected TlsSecret
safeDecryptPreMasterSecret(TlsCryptoParameters cryptoParams, java.security.PrivateKey rsaServerPrivateKey, byte[] encryptedPreMasterSecret)
-
-
-
Field Detail
-
crypto
protected JcaTlsCrypto crypto
-
certificate
protected Certificate certificate
-
privateKey
protected java.security.PrivateKey privateKey
-
-
Constructor Detail
-
JceDefaultTlsCredentialedDecryptor
public JceDefaultTlsCredentialedDecryptor(JcaTlsCrypto crypto, Certificate certificate, java.security.PrivateKey privateKey)
-
-
Method Detail
-
getCertificate
public Certificate getCertificate()
Description copied from interface:TlsCredentials
Return the certificate structure representing our identity.- Specified by:
getCertificate
in interfaceTlsCredentials
- Returns:
- our certificate structure.
-
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 interfaceTlsCredentialedDecryptor
- 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, java.security.PrivateKey rsaServerPrivateKey, byte[] encryptedPreMasterSecret)
-
-