declare namespace javax { namespace net { namespace ssl { /** * Instances of this class represent a server name of type * {@link StandardConstants#SNI_HOST_NAME host_name} in a Server Name * Indication (SNI) extension. *

* As described in section 3, "Server Name Indication", of * TLS Extensions (RFC 6066), * "HostName" contains the fully qualified DNS hostname of the server, as * understood by the client. The encoded server name value of a hostname is * represented as a byte string using ASCII encoding without a trailing dot. * This allows the support of Internationalized Domain Names (IDN) through * the use of A-labels (the ASCII-Compatible Encoding (ACE) form of a valid * string of Internationalized Domain Names for Applications (IDNA)) defined * in RFC 5890. *

* Note that {@code SNIHostName} objects are immutable. * @see SNIServerName * @see StandardConstants#SNI_HOST_NAME * @since 1.8 */ // @ts-ignore class SNIHostName extends javax.net.ssl.SNIServerName { /** * Creates an {@code SNIHostName} using the specified hostname. *

* Note that per RFC 6066, * the encoded server name value of a hostname is * {@link StandardCharsets#US_ASCII}-compliant. In this method, * {@code hostname} can be a user-friendly Internationalized Domain Name * (IDN). {@link IDN#toASCII(String, int)} is used to enforce the * restrictions on ASCII characters in hostnames (see * RFC 3490, * RFC 1122, * RFC 1123) and * translate the {@code hostname} into ASCII Compatible Encoding (ACE), as: *

                 * IDN.toASCII(hostname, IDN.USE_STD3_ASCII_RULES);
                 * 
*

* The {@code hostname} argument is illegal if it: *

* @param hostname * the hostname of this server name * @throws NullPointerException if {#code hostname} is {@code null} * @throws IllegalArgumentException if {#code hostname} is illegal */ // @ts-ignore constructor(hostname: java.lang.String | string) /** * Creates an {@code SNIHostName} using the specified encoded value. *

* This method is normally used to parse the encoded name value in a * requested SNI extension. *

* Per RFC 6066, * the encoded name value of a hostname is * {@link StandardCharsets#US_ASCII}-compliant. However, in the previous * version of the SNI extension ( * RFC 4366), * the encoded hostname is represented as a byte string using UTF-8 * encoding. For the purpose of version tolerance, this method allows * that the charset of {@code encoded} argument can be * {@link StandardCharsets#UTF_8}, as well as * {@link StandardCharsets#US_ASCII}. {@link IDN#toASCII(String)} is used * to translate the {@code encoded} argument into ASCII Compatible * Encoding (ACE) hostname. *

* It is strongly recommended that this constructor is only used to parse * the encoded name value in a requested SNI extension. Otherwise, to * comply with RFC 6066, * please always use {@link StandardCharsets#US_ASCII}-compliant charset * and enforce the restrictions on ASCII characters in hostnames (see * RFC 3490, * RFC 1122, * RFC 1123) * for {@code encoded} argument, or use * {@link SNIHostName#SNIHostName(String)} instead. *

* The {@code encoded} argument is illegal if it: *

*

* Note that the {@code encoded} byte array is cloned * to protect against subsequent modification. * @param encoded * the encoded hostname of this server name * @throws NullPointerException if {#code encoded} is {@code null} * @throws IllegalArgumentException if {#code encoded} is illegal */ // @ts-ignore constructor(encoded: number /*byte*/[]) /** * Returns the {@link StandardCharsets#US_ASCII}-compliant hostname of * this {@code SNIHostName} object. *

* Note that, per * RFC 6066, the * returned hostname may be an internationalized domain name that * contains A-labels. See * RFC 5890 * for more information about the detailed A-label specification. * @return the {#link StandardCharsets#US_ASCII}-compliant hostname * of this {@code SNIHostName} object */ // @ts-ignore public getAsciiName(): string /** * Compares this server name to the specified object. *

* Per RFC 6066, DNS * hostnames are case-insensitive. Two server hostnames are equal if, * and only if, they have the same name type, and the hostnames are * equal in a case-independent comparison. * @param other * the other server name object to compare with. * @return true if, and only if, the {#code other} is considered * equal to this instance */ // @ts-ignore public equals(other: java.lang.Object | any): boolean /** * Returns a hash code value for this {@code SNIHostName}. *

* The hash code value is generated using the case-insensitive hostname * of this {@code SNIHostName}. * @return a hash code value for this {#code SNIHostName}. */ // @ts-ignore public hashCode(): number /*int*/ /** * Returns a string representation of the object, including the DNS * hostname in this {@code SNIHostName} object. *

* The exact details of the representation are unspecified and subject * to change, but the following may be regarded as typical: *

                 * "type=host_name (0), value={@literal }"
                 * 
* The "{@literal }" is an ASCII representation of the hostname, * which may contains A-labels. For example, a returned value of an pseudo * hostname may look like: *
                 * "type=host_name (0), value=www.example.com"
                 * 
* or *
                 * "type=host_name (0), value=xn--fsqu00a.xn--0zwm56d"
                 * 
*

* Please NOTE that the exact details of the representation are unspecified * and subject to change. * @return a string representation of the object. */ // @ts-ignore public toString(): string /** * Creates an {@link SNIMatcher} object for {@code SNIHostName}s. *

* This method can be used by a server to verify the acceptable * {@code SNIHostName}s. For example, *

                 * SNIMatcher matcher =
                 * SNIHostName.createSNIMatcher("www\\.example\\.com");
                 * 
* will accept the hostname "www.example.com". *
                 * SNIMatcher matcher =
                 * SNIHostName.createSNIMatcher("www\\.example\\.(com|org)");
                 * 
* will accept hostnames "www.example.com" and "www.example.org". * @param regex * the * regular expression pattern * representing the hostname(s) to match * @return a {#code SNIMatcher} object for {@code SNIHostName}s * @throws NullPointerException if {#code regex} is * {@code null} * @throws java.util.regex.PatternSyntaxException if the regular expression's * syntax is invalid */ // @ts-ignore public static createSNIMatcher(regex: java.lang.String | string): javax.net.ssl.SNIMatcher } } } }