Class BcDefaultTlsCredentialedDecryptor
- java.lang.Object
-
- org.bouncycastle.tls.crypto.impl.bc.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 Summary
Fields Modifier and Type Field Description protected Certificatecertificateprotected BcTlsCryptocryptoprotected org.bouncycastle.crypto.params.AsymmetricKeyParameterprivateKey
-
Constructor Summary
Constructors Constructor Description BcDefaultTlsCredentialedDecryptor(BcTlsCrypto crypto, Certificate certificate, org.bouncycastle.crypto.params.AsymmetricKeyParameter privateKey)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TlsSecretdecrypt(TlsCryptoParameters cryptoParams, byte[] ciphertext)Decrypt the passed in cipher text using the parameters available.CertificategetCertificate()Return the certificate structure representing our identity.protected TlsSecretsafeDecryptPreMasterSecret(TlsCryptoParameters cryptoParams, org.bouncycastle.crypto.params.RSAKeyParameters rsaServerPrivateKey, byte[] encryptedPreMasterSecret)
-
-
-
Field Detail
-
crypto
protected BcTlsCrypto crypto
-
certificate
protected Certificate certificate
-
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
-
getCertificate
public Certificate getCertificate()
Description copied from interface:TlsCredentialsReturn the certificate structure representing our identity.- Specified by:
getCertificatein interfaceTlsCredentials- Returns:
- our certificate structure.
-
decrypt
public TlsSecret decrypt(TlsCryptoParameters cryptoParams, byte[] ciphertext) throws java.io.IOException
Description copied from interface:TlsCredentialedDecryptorDecrypt the passed in cipher text using the parameters available.- Specified by:
decryptin 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, org.bouncycastle.crypto.params.RSAKeyParameters rsaServerPrivateKey, byte[] encryptedPreMasterSecret)
-
-