Top Description Fields Constructors Methods
org.bouncycastle.tls

public final Class ServerName

extends Object
Class Inheritance
Imports
java.io.IOException, .InputStream, .OutputStream

RFC 6066 3. Server Name Indication Current implementation uses this guidance: "For backward compatibility, all future data structures associated with new NameTypes MUST begin with a 16-bit length field. TLS MAY treat provided server names as opaque data and pass the names and types to the application." RFC 6066 specifies ASCII encoding for host_name (possibly using A-labels for IDNs), but note that the previous version (RFC 4366) specified UTF-8 encoding (see RFC 6066 Appendix A). For maximum compatibility, it is recommended that client code tolerate receiving UTF-8 from the peer, but only generate ASCII itself.

Field Summary

Modifier and TypeField and Description
private final byte[]
private final short

Constructor Summary

AccessConstructor and Description
public
ServerName(short nameType, byte[] nameData)

Method Summary

Modifier and TypeMethod and Description
public void
encode(OutputStream
the OutputStream to encode to.
output
)

Encode this ServerName to an OutputStream.

public byte[]
public short
public static ServerName

Returns:

a ServerName object.
parse
(InputStream
the InputStream to parse from.
input
)

Parse a ServerName from an InputStream.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

nameDataback to summary
private final byte[] nameData
nameTypeback to summary
private final short nameType

Constructor Detail

ServerNameback to summary
public ServerName(short nameType, byte[] nameData)

Method Detail

encodeback to summary
public void encode(OutputStream output) throws IOException

Encode this ServerName to an OutputStream.

Parameters
output:OutputStream

the OutputStream to encode to.

getNameDataback to summary
public byte[] getNameData()
getNameTypeback to summary
public short getNameType()
parseback to summary
public static ServerName parse(InputStream input) throws IOException

Parse a ServerName from an InputStream.

Parameters
input:InputStream

the InputStream to parse from.

Returns:ServerName

a ServerName object.