- java.lang.Object
-
- net.luminis.tls.extension.Extension
-
- net.luminis.tls.extension.KeyShareExtension
-
public class KeyShareExtension extends Extension
The TLS "key_share" extension contains the endpoint's cryptographic parameters. See https://tools.ietf.org/html/rfc8446#section-4.2.8
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classKeyShareExtension.ECKeyShareEntrystatic classKeyShareExtension.KeyShareEntry
-
Field Summary
Fields Modifier and Type Field Description static java.util.Map<TlsConstants.NamedGroup,java.lang.Integer>CURVE_KEY_LENGTHSstatic java.util.List<TlsConstants.NamedGroup>supportedCurves
-
Constructor Summary
Constructors Constructor Description KeyShareExtension(java.nio.ByteBuffer buffer, TlsConstants.HandshakeType handshakeType)Assuming KeyShareServerHello: "In a ServerHello message, the "extension_data" field of this extension contains a KeyShareServerHello value..."KeyShareExtension(java.nio.ByteBuffer buffer, TlsConstants.HandshakeType handshakeType, boolean helloRetryRequestType)KeyShareExtension(java.security.interfaces.ECPublicKey publicKey, TlsConstants.NamedGroup ecCurve, TlsConstants.HandshakeType handshakeType)Assuming KeyShareClientHello: "In the ClientHello message, the "extension_data" field of this extension contains a "KeyShareClientHello" value..."KeyShareExtension(java.security.PublicKey publicKey, TlsConstants.NamedGroup ecCurve, TlsConstants.HandshakeType handshakeType)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]getBytes()java.util.List<KeyShareExtension.KeyShareEntry>getKeyShareEntries()protected intparseKeyShareEntry(java.nio.ByteBuffer buffer, boolean namedGroupOnly)static voidreverse(byte[] array)-
Methods inherited from class net.luminis.tls.extension.Extension
parseExtensionHeader, parseExtensionHeader
-
-
-
-
Field Detail
-
CURVE_KEY_LENGTHS
public static final java.util.Map<TlsConstants.NamedGroup,java.lang.Integer> CURVE_KEY_LENGTHS
-
supportedCurves
public static final java.util.List<TlsConstants.NamedGroup> supportedCurves
-
-
Constructor Detail
-
KeyShareExtension
public KeyShareExtension(java.security.interfaces.ECPublicKey publicKey, TlsConstants.NamedGroup ecCurve, TlsConstants.HandshakeType handshakeType)Assuming KeyShareClientHello: "In the ClientHello message, the "extension_data" field of this extension contains a "KeyShareClientHello" value..."- Parameters:
publicKey-ecCurve-
-
KeyShareExtension
public KeyShareExtension(java.security.PublicKey publicKey, TlsConstants.NamedGroup ecCurve, TlsConstants.HandshakeType handshakeType)
-
KeyShareExtension
public KeyShareExtension(java.nio.ByteBuffer buffer, TlsConstants.HandshakeType handshakeType) throws TlsProtocolExceptionAssuming KeyShareServerHello: "In a ServerHello message, the "extension_data" field of this extension contains a KeyShareServerHello value..."- Parameters:
buffer-- Throws:
TlsProtocolException
-
KeyShareExtension
public KeyShareExtension(java.nio.ByteBuffer buffer, TlsConstants.HandshakeType handshakeType, boolean helloRetryRequestType) throws TlsProtocolException- Throws:
TlsProtocolException
-
-
Method Detail
-
parseKeyShareEntry
protected int parseKeyShareEntry(java.nio.ByteBuffer buffer, boolean namedGroupOnly) throws TlsProtocolException- Throws:
TlsProtocolException
-
getKeyShareEntries
public java.util.List<KeyShareExtension.KeyShareEntry> getKeyShareEntries()
-
reverse
public static void reverse(byte[] array)
-
-