Package org.bouncycastle.tls
Class ServerName
- java.lang.Object
-
- org.bouncycastle.tls.ServerName
-
public final class ServerName extends java.lang.ObjectRFC 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.
-
-
Constructor Summary
Constructors Constructor Description ServerName(short nameType, byte[] nameData)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidencode(java.io.OutputStream output)Encode thisServerNameto anOutputStream.byte[]getNameData()shortgetNameType()static ServerNameparse(java.io.InputStream input)Parse aServerNamefrom anInputStream.
-
-
-
Method Detail
-
getNameType
public short getNameType()
-
getNameData
public byte[] getNameData()
-
encode
public void encode(java.io.OutputStream output) throws java.io.IOExceptionEncode thisServerNameto anOutputStream.- Parameters:
output- theOutputStreamto encode to.- Throws:
java.io.IOException
-
parse
public static ServerName parse(java.io.InputStream input) throws java.io.IOException
Parse aServerNamefrom anInputStream.- Parameters:
input- theInputStreamto parse from.- Returns:
- a
ServerNameobject. - Throws:
java.io.IOException
-
-