Top Fields Constructors Methods
org.bouncycastle.tls

pack-priv abstract Class AbstractTlsContext

extends Object
implements TlsContext
Class Inheritance
All Implemented Interfaces
org.bouncycastle.tls.TlsContext
Known Direct Subclasses
org.bouncycastle.tls.TlsClientContextImpl, org.bouncycastle.tls.TlsServerContextImpl
Imports
java.io.IOException, org.bouncycastle.tls.crypto.TlsCrypto, .TlsCryptoUtils, .TlsHash, .TlsNonceGenerator, .TlsSecret, org.bouncycastle.util.Arrays, .Pack

Field Summary

Modifier and TypeField and Description
private ProtocolVersion[]
private ProtocolVersion
private int
private static long
private TlsCrypto
private TlsNonceGenerator
private ProtocolVersion
private SecurityParameters
private SecurityParameters
private TlsSession
private Object

Constructor Summary

AccessConstructor and Description
pack-priv
AbstractTlsContext(TlsCrypto crypto, int connectionEnd)

Method Summary

Modifier and TypeMethod and Description
protected TlsSecret
protected TlsSecret
private static TlsNonceGenerator
createNonceGenerator(TlsCrypto crypto, int connectionEnd)

public byte[]
exportChannelBinding(int
A ChannelBinding constant specifying the channel binding to export.
channelBinding
)

Implements org.bouncycastle.tls.TlsContext.exportChannelBinding.

Export the value of the specified channel binding.
public byte[]
exportEarlyKeyingMaterial(String
indicates which application will use the exported keys.
asciiLabel
,
byte[]
allows the application using the exporter to mix its own data with the TLS PRF for the exporter output.
context
,
int
the number of bytes to generate.
length
)

Implements org.bouncycastle.tls.TlsContext.exportEarlyKeyingMaterial.

Export (early data) keying material according to RFC 5705: "Keying Material Exporters for TLS", as updated for TLS 1.3 (RFC 8446).
public byte[]
exportKeyingMaterial(String
indicates which application will use the exported keys.
asciiLabel
,
byte[]
allows the application using the exporter to mix its own data with the TLS PRF for the exporter output.
context
,
int
the number of bytes to generate.
length
)

Implements org.bouncycastle.tls.TlsContext.exportKeyingMaterial.

Export keying material according to RFC 5705: "Keying Material Exporters for TLS", as updated for TLS 1.3 (RFC 8446) when negotiated.
protected byte[]
exportKeyingMaterial13(TlsSecret secret, int cryptoHashAlgorithm, String asciiLabel, byte[] context, int length)

public ProtocolVersion[]
public ProtocolVersion
public TlsCrypto
public TlsNonceGenerator
public TlsSession
getResumableSession()

Implements org.bouncycastle.tls.TlsContext.getResumableSession.

Used to get the resumable session, if any, used by this connection.
public ProtocolVersion
public synchronized SecurityParameters
public synchronized SecurityParameters
public synchronized SecurityParameters
public ProtocolVersion
public TlsSession
getSession()

Implements org.bouncycastle.tls.TlsContext.getSession.

Used to get the session information for this connection.
public Object
pack-priv void
pack-priv void
pack-priv synchronized boolean
pack-priv synchronized boolean
private static synchronized long
pack-priv void
setClientSupportedVersions(ProtocolVersion[] clientSupportedVersions)

pack-priv void
pack-priv void
setRSAPreMasterSecretVersion(ProtocolVersion rsaPreMasterSecretVersion)

public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

clientSupportedVersionsback to summary
private ProtocolVersion[] clientSupportedVersions
clientVersionback to summary
private ProtocolVersion clientVersion
connectionEndback to summary
private int connectionEnd
counterback to summary
private static long counter
cryptoback to summary
private TlsCrypto crypto
nonceGeneratorback to summary
private TlsNonceGenerator nonceGenerator
rsaPreMasterSecretVersionback to summary
private ProtocolVersion rsaPreMasterSecretVersion
securityParametersConnectionback to summary
private SecurityParameters securityParametersConnection
securityParametersHandshakeback to summary
private SecurityParameters securityParametersHandshake
sessionback to summary
private TlsSession session
userObjectback to summary
private Object userObject

Constructor Detail

AbstractTlsContextback to summary
pack-priv AbstractTlsContext(TlsCrypto crypto, int connectionEnd)

Method Detail

checkEarlyExportSecretback to summary
protected TlsSecret checkEarlyExportSecret(TlsSecret secret)
checkExportSecretback to summary
protected TlsSecret checkExportSecret(TlsSecret secret)
createNonceGeneratorback to summary
private static TlsNonceGenerator createNonceGenerator(TlsCrypto crypto, int connectionEnd)
exportChannelBindingback to summary
public byte[] exportChannelBinding(int channelBinding)

Implements org.bouncycastle.tls.TlsContext.exportChannelBinding.

Doc from org.bouncycastle.tls.TlsContext.exportChannelBinding.

Export the value of the specified channel binding. Only available after the handshake has successfully completed.

Parameters
channelBinding:int

A ChannelBinding constant specifying the channel binding to export.

Returns:byte[]

A copy of the channel binding data as a \byte\[\]\, or null if the binding could not be determined.

exportEarlyKeyingMaterialback to summary
public byte[] exportEarlyKeyingMaterial(String asciiLabel, byte[] context, int length)

Implements org.bouncycastle.tls.TlsContext.exportEarlyKeyingMaterial.

Doc from org.bouncycastle.tls.TlsContext.exportEarlyKeyingMaterial.

Export (early data) keying material according to RFC 5705: "Keying Material Exporters for TLS", as updated for TLS 1.3 (RFC 8446).

Note

for use in settings where an exporter is needed for 0-RTT data.

Parameters
asciiLabel:String

indicates which application will use the exported keys.

context:byte[]

allows the application using the exporter to mix its own data with the TLS PRF for the exporter output.

length:int

the number of bytes to generate.

Returns:byte[]

a pseudorandom bit string of 'length' bytes generated from the (exporter_)master_secret.

exportKeyingMaterialback to summary
public byte[] exportKeyingMaterial(String asciiLabel, byte[] context, int length)

Implements org.bouncycastle.tls.TlsContext.exportKeyingMaterial.

Doc from org.bouncycastle.tls.TlsContext.exportKeyingMaterial.

Export keying material according to RFC 5705: "Keying Material Exporters for TLS", as updated for TLS 1.3 (RFC 8446) when negotiated.

Parameters
asciiLabel:String

indicates which application will use the exported keys.

context:byte[]

allows the application using the exporter to mix its own data with the TLS PRF for the exporter output.

length:int

the number of bytes to generate.

Returns:byte[]

a pseudorandom bit string of 'length' bytes generated from the (exporter_)master_secret.

exportKeyingMaterial13back to summary
protected byte[] exportKeyingMaterial13(TlsSecret secret, int cryptoHashAlgorithm, String asciiLabel, byte[] context, int length)
getClientSupportedVersionsback to summary
public ProtocolVersion[] getClientSupportedVersions()

Implements org.bouncycastle.tls.TlsContext.getClientSupportedVersions.

getClientVersionback to summary
public ProtocolVersion getClientVersion()

Implements org.bouncycastle.tls.TlsContext.getClientVersion.

getCryptoback to summary
public TlsCrypto getCrypto()

Implements org.bouncycastle.tls.TlsContext.getCrypto.

getNonceGeneratorback to summary
public TlsNonceGenerator getNonceGenerator()

Implements org.bouncycastle.tls.TlsContext.getNonceGenerator.

getResumableSessionback to summary
public TlsSession getResumableSession()

Implements org.bouncycastle.tls.TlsContext.getResumableSession.

Doc from org.bouncycastle.tls.TlsContext.getResumableSession.

Used to get the resumable session, if any, used by this connection. Only available after the handshake has successfully completed.

Returns:TlsSession

A TlsSession representing the resumable session used by this connection, or null if no resumable session available.

getRSAPreMasterSecretVersionback to summary
public ProtocolVersion getRSAPreMasterSecretVersion()

Implements org.bouncycastle.tls.TlsContext.getRSAPreMasterSecretVersion.

getSecurityParametersback to summary
public synchronized SecurityParameters getSecurityParameters()

Implements org.bouncycastle.tls.TlsContext.getSecurityParameters.

getSecurityParametersConnectionback to summary
public synchronized SecurityParameters getSecurityParametersConnection()

Implements org.bouncycastle.tls.TlsContext.getSecurityParametersConnection.

getSecurityParametersHandshakeback to summary
public synchronized SecurityParameters getSecurityParametersHandshake()

Implements org.bouncycastle.tls.TlsContext.getSecurityParametersHandshake.

getServerVersionback to summary
public ProtocolVersion getServerVersion()

Implements org.bouncycastle.tls.TlsContext.getServerVersion.

getSessionback to summary
public TlsSession getSession()

Implements org.bouncycastle.tls.TlsContext.getSession.

Doc from org.bouncycastle.tls.TlsContext.getSession.

Used to get the session information for this connection. Only available after the handshake has successfully completed. Use TlsSession#isResumable() to find out if the session is resumable.

Returns:TlsSession

A TlsSession representing the session used by this connection.

getUserObjectback to summary
public Object getUserObject()

Implements org.bouncycastle.tls.TlsContext.getUserObject.

handshakeBeginningback to summary
pack-priv void handshakeBeginning(TlsPeer peer) throws IOException
handshakeCompleteback to summary
pack-priv void handshakeComplete(TlsPeer peer, TlsSession session) throws IOException
isConnectedback to summary
pack-priv synchronized boolean isConnected()
isHandshakingback to summary
pack-priv synchronized boolean isHandshaking()
nextCounterValueback to summary
private static synchronized long nextCounterValue()
setClientSupportedVersionsback to summary
pack-priv void setClientSupportedVersions(ProtocolVersion[] clientSupportedVersions)
setClientVersionback to summary
pack-priv void setClientVersion(ProtocolVersion clientVersion)
setRSAPreMasterSecretVersionback to summary
pack-priv void setRSAPreMasterSecretVersion(ProtocolVersion rsaPreMasterSecretVersion)
setUserObjectback to summary
public void setUserObject(Object userObject)

Implements org.bouncycastle.tls.TlsContext.setUserObject.