public class TLSExporterChannelBinding extends ChannelBinding
tls-exporter channel binding
according to RFC 9266, RFC 5705 and RFC 8446 (section 7.5).
RFC 9266 specifies the tls-exporter
channel binding to be calculated from the ExtendedMasterSecret value (TLS
versions prior 1.3) or the tls exporter value (TLS 1.3).
An application that is interested to capture the tls-exporter channel binding
value has to announce its interest by adding a ChannelBindings containing the TLSExporterChannelBinding to the SSLContext object, e.g.:
ChannelBindings channelBindings = new ChannelBindings(); channelBindings.addChannelBinding(new TLSExporterChannelBinding()); context.setChannelBindings(channelBindings);
When using a TLS version prior TLS 1.3 the tls-exporter channel binding is only calculated
when the ExtendedMasterSecret extension is
enabled (and negotiated):
ExtensionList extensions = new ExtensionList(); ... // add any extensions ... // add ExtendedMasterSecret extension ExtendedMasterSecret extendedMasterSecret = new ExtendedMasterSecret(); extensions.addExtension(extendedMasterSecret); ... context.setExtensions(extensions); ...
After having completed the handshake the tls-exporter channel binding value
can be obtained from the SSLSocket:
ChannelBindings chBndgs = socket.getChannelBindings();
if (chBndgs != null) {
TLSExporterChannelBinding tlsExporter = (TLSExporterChannelBinding)chBndgs.getChannelBinding(TLSExporterChannelBinding.TYPE);
if (tlsExporter != null) {
System.out.println("tls-exporter: " + Util.toString(tlsExporter.getData()));
}
}
ChannelBinding,
ChannelBindings,
ChannelBindingType| Modifier and Type | Field and Description |
|---|---|
static byte[] |
L_EXPORTER
The "EXPORTER-Channel-Binding" label (RFC 9266).
|
static byte[] |
L_TLS13_EXPORTER
The TLS 1.3 "EXPORTER-Channel-Binding" label (RFC 9266).
|
static int |
LENGTH
The exporter length (RFC 9266).
|
static ChannelBindingType |
TYPE |
| Constructor and Description |
|---|
TLSExporterChannelBinding()
Default constructor.
|
TLSExporterChannelBinding(byte[] data)
Creates a TLSExporterChannelBinding with the given context value.
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getContext()
Gets the (always empty) context value.
|
clone, equals, getChannelBindingType, getData, getName, getType, hashCode, toString, toStringpublic static final ChannelBindingType TYPE
public static final byte[] L_EXPORTER
public static final byte[] L_TLS13_EXPORTER
public static final int LENGTH
public TLSExporterChannelBinding()
public TLSExporterChannelBinding(byte[] data)
context - the context value