< prev index next >

## src/java.base/share/classes/java/security/cert/CertPath.java

Print this page

      1 /*
      2  * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
      3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
      4  *
      5  * This code is free software; you can redistribute it and/or modify it
      6  * under the terms of the GNU General Public License version 2 only, as
      7  * published by the Free Software Foundation.  Oracle designates this
      8  * particular file as subject to the "Classpath" exception as provided
      9  * by Oracle in the LICENSE file that accompanied this code.
     10  *
     11  * This code is distributed in the hope that it will be useful, but WITHOUT
     12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
     13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
     14  * version 2 for more details (a copy is included in the LICENSE file that
     15  * accompanied this code).
     16  *
     17  * You should have received a copy of the GNU General Public License version
     18  * 2 along with this work; if not, write to the Free Software Foundation,
     19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
     20  *
     21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
     22  * or visit www.oracle.com if you need additional information or have any
    105  * ill effects. This is also true for the {@code List} returned by
    106  * {@code CertPath.getCertificates}.
    107  * <p>
    108  * Requiring {@code CertPath} objects to be immutable and thread-safe
    109  * allows them to be passed around to various pieces of code without worrying
    110  * about coordinating access.  Providing this thread-safety is
    111  * generally not difficult, since the {@code CertPath} and
    112  * {@code List} objects in question are immutable.
    113  *
    114  * @see CertificateFactory
    115  * @see CertPathBuilder
    116  *
    117  * @author      Yassir Elley
    118  * @since       1.4
    119  */
    120 public abstract class CertPath implements Serializable {
    121
    122     @java.io.Serial
    123     private static final long serialVersionUID = 6068470306649138683L;
    124
    125     private String type;        // the type of certificates in this chain

    126
    127     /**
    128      * Creates a {@code CertPath} of the specified type.
    129      * <p>
    130      * This constructor is protected because most users should use a
    131      * {@code CertificateFactory} to create {@code CertPath}s.
    132      *
    133      * @param type the standard name of the type of
    134      * {@code Certificate}s in this path
    135      */
    136     protected CertPath(String type) {
    137         this.type = type;
    138     }
    139
    140     /**
    141      * Returns the type of {@code Certificate}s in this certification
    142      * path. This is the same string that would be returned by
    143      * {@link java.security.cert.Certificate#getType() cert.getType()}
    144      * for all {@code Certificate}s in the certification path.
    145      *
      1 /*
      2  * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.
      3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
      4  *
      5  * This code is free software; you can redistribute it and/or modify it
      6  * under the terms of the GNU General Public License version 2 only, as
      7  * published by the Free Software Foundation.  Oracle designates this
      8  * particular file as subject to the "Classpath" exception as provided
      9  * by Oracle in the LICENSE file that accompanied this code.
     10  *
     11  * This code is distributed in the hope that it will be useful, but WITHOUT
     12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
     13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
     14  * version 2 for more details (a copy is included in the LICENSE file that
     15  * accompanied this code).
     16  *
     17  * You should have received a copy of the GNU General Public License version
     18  * 2 along with this work; if not, write to the Free Software Foundation,
     19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
     20  *
     21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
     22  * or visit www.oracle.com if you need additional information or have any
    105  * ill effects. This is also true for the {@code List} returned by
    106  * {@code CertPath.getCertificates}.
    107  * <p>
    108  * Requiring {@code CertPath} objects to be immutable and thread-safe
    109  * allows them to be passed around to various pieces of code without worrying
    110  * about coordinating access.  Providing this thread-safety is
    111  * generally not difficult, since the {@code CertPath} and
    112  * {@code List} objects in question are immutable.
    113  *
    114  * @see CertificateFactory
    115  * @see CertPathBuilder
    116  *
    117  * @author      Yassir Elley
    118  * @since       1.4
    119  */
    120 public abstract class CertPath implements Serializable {
    121
    122     @java.io.Serial
    123     private static final long serialVersionUID = 6068470306649138683L;
    124
    125     /** The type of certificates in this chain. */
    126     private String type;
    127
    128     /**
    129      * Creates a {@code CertPath} of the specified type.
    130      * <p>
    131      * This constructor is protected because most users should use a
    132      * {@code CertificateFactory} to create {@code CertPath}s.
    133      *
    134      * @param type the standard name of the type of
    135      * {@code Certificate}s in this path
    136      */
    137     protected CertPath(String type) {
    138         this.type = type;
    139     }
    140
    141     /**
    142      * Returns the type of {@code Certificate}s in this certification
    143      * path. This is the same string that would be returned by
    144      * {@link java.security.cert.Certificate#getType() cert.getType()}
    145      * for all {@code Certificate}s in the certification path.
    146      *

< prev index next >