Class BcDefaultTlsCredentialedAgreement
- java.lang.Object
-
- org.bouncycastle.tls.crypto.impl.bc.BcDefaultTlsCredentialedAgreement
-
- All Implemented Interfaces:
TlsCredentialedAgreement
,TlsCredentials
public class BcDefaultTlsCredentialedAgreement extends java.lang.Object implements TlsCredentialedAgreement
Credentialed class generating agreed secrets from a peer's public key for our end of the TLS connection using the BC light-weight API.
-
-
Field Summary
Fields Modifier and Type Field Description protected TlsCredentialedAgreement
agreementCredentials
-
Constructor Summary
Constructors Constructor Description BcDefaultTlsCredentialedAgreement(BcTlsCrypto crypto, Certificate certificate, org.bouncycastle.crypto.params.AsymmetricKeyParameter privateKey)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TlsSecret
generateAgreement(TlsCertificate peerCertificate)
Calculate an agreed secret based on our credentials and the public key credentials of our peer.Certificate
getCertificate()
Return the certificate structure representing our identity.
-
-
-
Field Detail
-
agreementCredentials
protected TlsCredentialedAgreement agreementCredentials
-
-
Constructor Detail
-
BcDefaultTlsCredentialedAgreement
public BcDefaultTlsCredentialedAgreement(BcTlsCrypto crypto, Certificate certificate, org.bouncycastle.crypto.params.AsymmetricKeyParameter 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.
-
generateAgreement
public TlsSecret generateAgreement(TlsCertificate peerCertificate) throws java.io.IOException
Description copied from interface:TlsCredentialedAgreement
Calculate an agreed secret based on our credentials and the public key credentials of our peer.- Specified by:
generateAgreement
in interfaceTlsCredentialedAgreement
- Parameters:
peerCertificate
- public key certificate of our TLS peer.- Returns:
- the agreed secret.
- Throws:
java.io.IOException
- in case of an exception on generation of the secret.
-
-