public final class ServerNameExtension extends HelloExtension
See RFC 6066, Section 3 for additional details.
HelloExtension.ExtensionTypeLENGTH_BITS, TYPE_BITS| Modifier and Type | Method and Description |
|---|---|
void |
addExtensionData(org.eclipse.californium.elements.util.DatagramWriter writer)
Adds binary encoding of this extension's data.
|
static ServerNameExtension |
emptyServerNameIndication()
Creates a new empty Server Name Indication extension.
|
static ServerNameExtension |
forServerNames(ServerNames serverNames)
Creates a new instance for a server name list.
|
static ServerNameExtension |
fromExtensionDataReader(org.eclipse.californium.elements.util.DatagramReader extensionDataReader,
InetSocketAddress peerAddress)
Creates a new instance from its byte representation.
|
int |
getLength()
Gets the overall length of this extension's corresponding Extension struct.
|
ServerNames |
getServerNames()
Gets the server name list conveyed in this extension.
|
fromExtensionDataReader, toByteArray, toStringpublic static ServerNameExtension emptyServerNameIndication()
This method should be used by a server that wants to include an empty Server Name Indication extension in its SERVER_HELLO handshake message.
public static ServerNameExtension forServerNames(ServerNames serverNames)
This constructor should be used by a client who wants to include the Server Name Indication extension in its CLIENT_HELLO handshake message.
serverNames - The server names.NullPointerException - if the server name list is null.public void addExtensionData(org.eclipse.californium.elements.util.DatagramWriter writer)
HelloExtensionThis implementation does not do anything. Sub-classes should override this method and use the passed-in writer to add their extension_data bytes to the Extension data structure.
NB: Subclasses MUST NOT write the extension's type code to the writer
as this will already have been done by the HelloExtension.toByteArray() method.
addExtensionData in class HelloExtensionwriter - the writer to use for serializationpublic static ServerNameExtension fromExtensionDataReader(org.eclipse.californium.elements.util.DatagramReader extensionDataReader, InetSocketAddress peerAddress) throws HandshakeException
extensionDataReader - The byte representation.peerAddress - The IP address and port that the extension has been received from.HandshakeException - if the byte representation could not be parsed.public ServerNames getServerNames()
public int getLength()
HelloExtensionNote that this includes the 2 bytes indicating the extension type.
getLength in class HelloExtensionCopyright © 2023 Eclipse Foundation. All rights reserved.