Class BcX25519
java.lang.Object
org.bouncycastle.tls.crypto.impl.bc.BcX25519
- All Implemented Interfaces:
TlsAgreement
Support class for X25519 using the BC light-weight library.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final BcTlsCryptoprotected final byte[]protected final byte[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCalculate the agreed secret based on the calculator's current state.byte[]Generate an ephemeral key pair, returning the encoding of the public key.voidreceivePeerValue(byte[] peerValue) Pass in the public key for the peer to the agreement calculator.
-
Field Details
-
crypto
-
privateKey
protected final byte[] privateKey -
peerPublicKey
protected final byte[] peerPublicKey
-
-
Constructor Details
-
BcX25519
-
-
Method Details
-
generateEphemeral
Description copied from interface:TlsAgreementGenerate an ephemeral key pair, returning the encoding of the public key.- Specified by:
generateEphemeralin interfaceTlsAgreement- Returns:
- a byte encoding of the public key.
- Throws:
IOException- in case of error.
-
receivePeerValue
Description copied from interface:TlsAgreementPass in the public key for the peer to the agreement calculator.- Specified by:
receivePeerValuein interfaceTlsAgreement- Parameters:
peerValue- a byte encoding of the peer public key.- Throws:
IOException- in case of error.
-
calculateSecret
Description copied from interface:TlsAgreementCalculate the agreed secret based on the calculator's current state.- Specified by:
calculateSecretin interfaceTlsAgreement- Returns:
- the calculated secret.
- Throws:
IOException- in case of error.
-