public class BcDefaultTlsCredentialedDecryptor extends java.lang.Object implements TlsCredentialedDecryptor
Modifier and Type | Field and Description |
---|---|
protected Certificate |
certificate |
protected BcTlsCrypto |
crypto |
protected org.bouncycastle.crypto.params.AsymmetricKeyParameter |
privateKey |
Constructor and Description |
---|
BcDefaultTlsCredentialedDecryptor(BcTlsCrypto crypto,
Certificate certificate,
org.bouncycastle.crypto.params.AsymmetricKeyParameter privateKey) |
Modifier and Type | Method and 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,
org.bouncycastle.crypto.params.RSAKeyParameters rsaServerPrivateKey,
byte[] encryptedPreMasterSecret) |
protected BcTlsCrypto crypto
protected Certificate certificate
protected org.bouncycastle.crypto.params.AsymmetricKeyParameter privateKey
public BcDefaultTlsCredentialedDecryptor(BcTlsCrypto crypto, Certificate certificate, org.bouncycastle.crypto.params.AsymmetricKeyParameter privateKey)
public Certificate getCertificate()
TlsCredentials
getCertificate
in interface TlsCredentials
public TlsSecret decrypt(TlsCryptoParameters cryptoParams, byte[] ciphertext) throws java.io.IOException
TlsCredentialedDecryptor
decrypt
in interface TlsCredentialedDecryptor
cryptoParams
- the parameters to use for the decryption.ciphertext
- the cipher text containing the secret.java.io.IOException
- on a parsing or decryption error.protected TlsSecret safeDecryptPreMasterSecret(TlsCryptoParameters cryptoParams, org.bouncycastle.crypto.params.RSAKeyParameters rsaServerPrivateKey, byte[] encryptedPreMasterSecret)