Top Description Fields Constructors Methods
org.bouncycastle.tls.crypto.impl.bc

public Class BcX25519

extends Object
implements TlsAgreement
Class Inheritance
All Implemented Interfaces
org.bouncycastle.tls.crypto.TlsAgreement
Imports
java.io.IOException, org.bouncycastle.math.ec.rfc7748.X25519, org.bouncycastle.tls.AlertDescription, .TlsFatalAlert, org.bouncycastle.tls.crypto.TlsAgreement, .TlsSecret, org.bouncycastle.util.Arrays

Support class for X25519 using the BC light-weight library.

Field Summary

Modifier and TypeField and Description
protected final BcTlsCrypto
protected final byte[]
protected final byte[]

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public TlsSecret
calculateSecret()

Implements org.bouncycastle.tls.crypto.TlsAgreement.calculateSecret.

Calculate the agreed secret based on the calculator's current state.

public byte[]
generateEphemeral()

Implements org.bouncycastle.tls.crypto.TlsAgreement.generateEphemeral.

Generate an ephemeral key pair, returning the encoding of the public key.

public void
receivePeerValue(byte[]
a byte encoding of the peer public key.
peerValue
)

Implements org.bouncycastle.tls.crypto.TlsAgreement.receivePeerValue.

Pass in the public key for the peer to the agreement calculator.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cryptoback to summary
protected final BcTlsCrypto crypto
peerPublicKeyback to summary
protected final byte[] peerPublicKey
privateKeyback to summary
protected final byte[] privateKey

Constructor Detail

BcX25519back to summary
public BcX25519(BcTlsCrypto crypto)

Method Detail

calculateSecretback to summary
public TlsSecret calculateSecret() throws IOException

Implements org.bouncycastle.tls.crypto.TlsAgreement.calculateSecret.

Doc from org.bouncycastle.tls.crypto.TlsAgreement.calculateSecret.

Calculate the agreed secret based on the calculator's current state.

Returns:TlsSecret

the calculated secret.

Exceptions
IOException:
in case of error.
generateEphemeralback to summary
public byte[] generateEphemeral() throws IOException

Implements org.bouncycastle.tls.crypto.TlsAgreement.generateEphemeral.

Doc from org.bouncycastle.tls.crypto.TlsAgreement.generateEphemeral.

Generate an ephemeral key pair, returning the encoding of the public key.

Returns:byte[]

a byte encoding of the public key.

Exceptions
IOException:
in case of error.
receivePeerValueback to summary
public void receivePeerValue(byte[] peerValue) throws IOException

Implements org.bouncycastle.tls.crypto.TlsAgreement.receivePeerValue.

Doc from org.bouncycastle.tls.crypto.TlsAgreement.receivePeerValue.

Pass in the public key for the peer to the agreement calculator.

Parameters
peerValue:byte[]

a byte encoding of the peer public key.

Exceptions
IOException:
in case of error.