Class JceDefaultTlsCredentialedAgreement
- java.lang.Object
-
- org.bouncycastle.tls.crypto.impl.jcajce.JceDefaultTlsCredentialedAgreement
-
- All Implemented Interfaces:
TlsCredentialedAgreement
,TlsCredentials
public class JceDefaultTlsCredentialedAgreement 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 JCE.
-
-
Constructor Summary
Constructors Constructor Description JceDefaultTlsCredentialedAgreement(JcaTlsCrypto crypto, Certificate certificate, java.security.PrivateKey privateKey)
-
Method Summary
All Methods Static 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.static java.lang.String
getAgreementAlgorithm(java.security.PrivateKey privateKey)
Certificate
getCertificate()
Return the certificate structure representing our identity.
-
-
-
Constructor Detail
-
JceDefaultTlsCredentialedAgreement
public JceDefaultTlsCredentialedAgreement(JcaTlsCrypto crypto, Certificate certificate, java.security.PrivateKey privateKey)
-
-
Method Detail
-
getAgreementAlgorithm
public static java.lang.String getAgreementAlgorithm(java.security.PrivateKey privateKey)
-
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.
-
-