jdk/src/java.base/share/classes/sun/security/ssl/ExtensionType.java
author martin
Tue, 15 Sep 2015 21:56:04 -0700
changeset 32649 2ee9017c7597
parent 32032 22badc53802f
child 34380 2b2609379881
permissions -rw-r--r--
8136583: Core libraries should use blessed modifier order Summary: Run blessed-modifier-order script (see bug) Reviewed-by: psandoz, chegar, alanb, plevart
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
14330
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
     1
/*
30897
58150036d89b 8081027: Create a common test to check adequacy of initial size of static HashMap/ArrayList fields
igerasim
parents: 25859
diff changeset
     2
 * Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved.
14330
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
     4
 *
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    10
 *
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    15
 * accompanied this code).
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    16
 *
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    20
 *
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    23
 * questions.
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    24
 */
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    25
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    26
package sun.security.ssl;
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    27
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    28
import java.util.ArrayList;
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    29
import java.util.List;
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    30
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    31
final class ExtensionType {
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    32
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    33
    final int id;
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    34
    final String name;
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    35
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    36
    private ExtensionType(int id, String name) {
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    37
        this.id = id;
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    38
        this.name = name;
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    39
    }
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    40
14664
e71aa0962e70 8003950: Adds missing Override annotations and removes unnecessary imports in sun.security.ssl
xuelei
parents: 14342
diff changeset
    41
    @Override
14330
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    42
    public String toString() {
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    43
        return name;
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    44
    }
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    45
30897
58150036d89b 8081027: Create a common test to check adequacy of initial size of static HashMap/ArrayList fields
igerasim
parents: 25859
diff changeset
    46
    static List<ExtensionType> knownExtensions =
32032
22badc53802f 8046321: OCSP Stapling for TLS
jnimeh
parents: 30897
diff changeset
    47
            new ArrayList<ExtensionType>(14);
14330
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    48
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    49
    static ExtensionType get(int id) {
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    50
        for (ExtensionType ext : knownExtensions) {
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    51
            if (ext.id == id) {
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    52
                return ext;
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    53
            }
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    54
        }
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    55
        return new ExtensionType(id, "type_" + id);
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    56
    }
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    57
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    58
    private static ExtensionType e(int id, String name) {
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    59
        ExtensionType ext = new ExtensionType(id, name);
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    60
        knownExtensions.add(ext);
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    61
        return ext;
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    62
    }
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    63
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    64
    // extensions defined in RFC 3546
32649
2ee9017c7597 8136583: Core libraries should use blessed modifier order
martin
parents: 32032
diff changeset
    65
    static final ExtensionType EXT_SERVER_NAME =
14330
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    66
            e(0x0000, "server_name");            // IANA registry value: 0
32649
2ee9017c7597 8136583: Core libraries should use blessed modifier order
martin
parents: 32032
diff changeset
    67
    static final ExtensionType EXT_MAX_FRAGMENT_LENGTH =
14330
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    68
            e(0x0001, "max_fragment_length");    // IANA registry value: 1
32649
2ee9017c7597 8136583: Core libraries should use blessed modifier order
martin
parents: 32032
diff changeset
    69
    static final ExtensionType EXT_CLIENT_CERTIFICATE_URL =
14330
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    70
            e(0x0002, "client_certificate_url"); // IANA registry value: 2
32649
2ee9017c7597 8136583: Core libraries should use blessed modifier order
martin
parents: 32032
diff changeset
    71
    static final ExtensionType EXT_TRUSTED_CA_KEYS =
14330
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    72
            e(0x0003, "trusted_ca_keys");        // IANA registry value: 3
32649
2ee9017c7597 8136583: Core libraries should use blessed modifier order
martin
parents: 32032
diff changeset
    73
    static final ExtensionType EXT_TRUNCATED_HMAC =
14330
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    74
            e(0x0004, "truncated_hmac");         // IANA registry value: 4
32649
2ee9017c7597 8136583: Core libraries should use blessed modifier order
martin
parents: 32032
diff changeset
    75
    static final ExtensionType EXT_STATUS_REQUEST =
14330
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    76
            e(0x0005, "status_request");         // IANA registry value: 5
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    77
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    78
    // extensions defined in RFC 4681
32649
2ee9017c7597 8136583: Core libraries should use blessed modifier order
martin
parents: 32032
diff changeset
    79
    static final ExtensionType EXT_USER_MAPPING =
14330
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    80
            e(0x0006, "user_mapping");           // IANA registry value: 6
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    81
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    82
    // extensions defined in RFC 5081
32649
2ee9017c7597 8136583: Core libraries should use blessed modifier order
martin
parents: 32032
diff changeset
    83
    static final ExtensionType EXT_CERT_TYPE =
14330
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    84
            e(0x0009, "cert_type");              // IANA registry value: 9
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    85
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    86
    // extensions defined in RFC 4492 (ECC)
32649
2ee9017c7597 8136583: Core libraries should use blessed modifier order
martin
parents: 32032
diff changeset
    87
    static final ExtensionType EXT_ELLIPTIC_CURVES =
14330
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    88
            e(0x000A, "elliptic_curves");        // IANA registry value: 10
32649
2ee9017c7597 8136583: Core libraries should use blessed modifier order
martin
parents: 32032
diff changeset
    89
    static final ExtensionType EXT_EC_POINT_FORMATS =
14330
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    90
            e(0x000B, "ec_point_formats");       // IANA registry value: 11
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    91
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    92
    // extensions defined in RFC 5054
32649
2ee9017c7597 8136583: Core libraries should use blessed modifier order
martin
parents: 32032
diff changeset
    93
    static final ExtensionType EXT_SRP =
14330
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    94
            e(0x000C, "srp");                    // IANA registry value: 12
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    95
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    96
    // extensions defined in RFC 5246
32649
2ee9017c7597 8136583: Core libraries should use blessed modifier order
martin
parents: 32032
diff changeset
    97
    static final ExtensionType EXT_SIGNATURE_ALGORITHMS =
14330
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    98
            e(0x000D, "signature_algorithms");   // IANA registry value: 13
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
    99
32032
22badc53802f 8046321: OCSP Stapling for TLS
jnimeh
parents: 30897
diff changeset
   100
    // extensions defined in RFC 6961
32649
2ee9017c7597 8136583: Core libraries should use blessed modifier order
martin
parents: 32032
diff changeset
   101
    static final ExtensionType EXT_STATUS_REQUEST_V2 =
32032
22badc53802f 8046321: OCSP Stapling for TLS
jnimeh
parents: 30897
diff changeset
   102
            e(0x0011, "status_request_v2");      // IANA registry value: 17
22badc53802f 8046321: OCSP Stapling for TLS
jnimeh
parents: 30897
diff changeset
   103
14330
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
   104
    // extensions defined in RFC 5746
32649
2ee9017c7597 8136583: Core libraries should use blessed modifier order
martin
parents: 32032
diff changeset
   105
    static final ExtensionType EXT_RENEGOTIATION_INFO =
14330
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
   106
            e(0xff01, "renegotiation_info");     // IANA registry value: 65281
e4cb78065603 8000970: break out auxiliary classes that will prevent multi-core compilation of the JDK
ohrstrom
parents:
diff changeset
   107
}