ServerName (Bouncy Castle Library 1.54 API Specification)
Date: 2015-12-29

org.bouncycastle.crypto.tls

## Class ServerName

- java.lang.Object
- - org.bouncycastle.crypto.tls.ServerName

-     public class ServerName
      extends java.lang.Object

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected java.lang.Object` | `name`
    `protected short` | `nameType`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ServerName(short nameType, java.lang.Object name)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `encode(java.io.OutputStream output)` Encode this `ServerName` to an `OutputStream`.
    `java.lang.String` | `getHostName()`
    `java.lang.Object` | `getName()`
    `short` | `getNameType()`
    `protected static boolean` | `isCorrectType(short nameType, java.lang.Object name)`
    `static ServerName` | `parse(java.io.InputStream input)` Parse a `ServerName` from an `InputStream`.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### nameType

          protected short nameType

    - #### name

          protected java.lang.Object name

  - ### Constructor Detail

    - #### ServerName

          public ServerName(short nameType,
                    java.lang.Object name)

  - ### Method Detail

    - #### getNameType

          public short getNameType()

    - #### getName

          public java.lang.Object getName()

    - #### getHostName

          public java.lang.String getHostName()

    - #### encode

          public void encode(java.io.OutputStream output)
                      throws java.io.IOException

      Encode this `ServerName` to an `OutputStream`.
      Parameters:
        `output` - the `OutputStream` to encode to.
      Throws:
        `java.io.IOException`

    - #### parse

          public static ServerName parse(java.io.InputStream input)
                                  throws java.io.IOException

      Parse a `ServerName` from an `InputStream`.
      Parameters:
        `input` - the `InputStream` to parse from.
      Returns:
        a `ServerName` object.
      Throws:
        `java.io.IOException`

    - #### isCorrectType

          protected static boolean isCorrectType(short nameType,
                              java.lang.Object name)