Package org.bouncycastle.tls
Class ServerName
java.lang.Object
org.bouncycastle.tls.ServerName
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.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
encode
(OutputStream output) Encode thisServerName
to anOutputStream
.byte[]
short
static ServerName
parse
(InputStream input) Parse aServerName
from anInputStream
.
-
Constructor Details
-
ServerName
public ServerName(short nameType, byte[] nameData)
-
-
Method Details
-
getNameType
public short getNameType() -
getNameData
public byte[] getNameData() -
encode
Encode thisServerName
to anOutputStream
.- Parameters:
output
- theOutputStream
to encode to.- Throws:
IOException
-
parse
Parse aServerName
from anInputStream
.- Parameters:
input
- theInputStream
to parse from.- Returns:
- a
ServerName
object. - Throws:
IOException
-