151b1b6997fd3f980076b8081f7f1165ccc2a4008Piotr Jastrzebski/*
294c24c5bb69f6dfec482f85f767ef0fc7dd98cbbSergio Giro * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
351b1b6997fd3f980076b8081f7f1165ccc2a4008Piotr Jastrzebski * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
451b1b6997fd3f980076b8081f7f1165ccc2a4008Piotr Jastrzebski *
551b1b6997fd3f980076b8081f7f1165ccc2a4008Piotr Jastrzebski * This code is free software; you can redistribute it and/or modify it
651b1b6997fd3f980076b8081f7f1165ccc2a4008Piotr Jastrzebski * under the terms of the GNU General Public License version 2 only, as
751b1b6997fd3f980076b8081f7f1165ccc2a4008Piotr Jastrzebski * published by the Free Software Foundation.  Oracle designates this
851b1b6997fd3f980076b8081f7f1165ccc2a4008Piotr Jastrzebski * particular file as subject to the "Classpath" exception as provided
951b1b6997fd3f980076b8081f7f1165ccc2a4008Piotr Jastrzebski * by Oracle in the LICENSE file that accompanied this code.
1051b1b6997fd3f980076b8081f7f1165ccc2a4008Piotr Jastrzebski *
1151b1b6997fd3f980076b8081f7f1165ccc2a4008Piotr Jastrzebski * This code is distributed in the hope that it will be useful, but WITHOUT
1251b1b6997fd3f980076b8081f7f1165ccc2a4008Piotr Jastrzebski * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1351b1b6997fd3f980076b8081f7f1165ccc2a4008Piotr Jastrzebski * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
1451b1b6997fd3f980076b8081f7f1165ccc2a4008Piotr Jastrzebski * version 2 for more details (a copy is included in the LICENSE file that
1551b1b6997fd3f980076b8081f7f1165ccc2a4008Piotr Jastrzebski * accompanied this code).
1651b1b6997fd3f980076b8081f7f1165ccc2a4008Piotr Jastrzebski *
1751b1b6997fd3f980076b8081f7f1165ccc2a4008Piotr Jastrzebski * You should have received a copy of the GNU General Public License version
1851b1b6997fd3f980076b8081f7f1165ccc2a4008Piotr Jastrzebski * 2 along with this work; if not, write to the Free Software Foundation,
1951b1b6997fd3f980076b8081f7f1165ccc2a4008Piotr Jastrzebski * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
2051b1b6997fd3f980076b8081f7f1165ccc2a4008Piotr Jastrzebski *
2151b1b6997fd3f980076b8081f7f1165ccc2a4008Piotr Jastrzebski * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2251b1b6997fd3f980076b8081f7f1165ccc2a4008Piotr Jastrzebski * or visit www.oracle.com if you need additional information or have any
2351b1b6997fd3f980076b8081f7f1165ccc2a4008Piotr Jastrzebski * questions.
2451b1b6997fd3f980076b8081f7f1165ccc2a4008Piotr Jastrzebski */
2551b1b6997fd3f980076b8081f7f1165ccc2a4008Piotr Jastrzebski
2651b1b6997fd3f980076b8081f7f1165ccc2a4008Piotr Jastrzebskipackage java.security.cert;
2751b1b6997fd3f980076b8081f7f1165ccc2a4008Piotr Jastrzebski
2851b1b6997fd3f980076b8081f7f1165ccc2a4008Piotr Jastrzebski/**
2994c24c5bb69f6dfec482f85f767ef0fc7dd98cbbSergio Giro * A specification of {@code CertStore} parameters.
3051b1b6997fd3f980076b8081f7f1165ccc2a4008Piotr Jastrzebski * <p>
3151b1b6997fd3f980076b8081f7f1165ccc2a4008Piotr Jastrzebski * The purpose of this interface is to group (and provide type safety for)
3294c24c5bb69f6dfec482f85f767ef0fc7dd98cbbSergio Giro * all {@code CertStore} parameter specifications. All
3394c24c5bb69f6dfec482f85f767ef0fc7dd98cbbSergio Giro * {@code CertStore} parameter specifications must implement this
3451b1b6997fd3f980076b8081f7f1165ccc2a4008Piotr Jastrzebski * interface.
3551b1b6997fd3f980076b8081f7f1165ccc2a4008Piotr Jastrzebski * <p>
3694c24c5bb69f6dfec482f85f767ef0fc7dd98cbbSergio Giro * Typically, a {@code CertStoreParameters} object is passed as a parameter
3751b1b6997fd3f980076b8081f7f1165ccc2a4008Piotr Jastrzebski * to one of the {@link CertStore#getInstance CertStore.getInstance} methods.
3894c24c5bb69f6dfec482f85f767ef0fc7dd98cbbSergio Giro * The {@code getInstance} method returns a {@code CertStore} that
3994c24c5bb69f6dfec482f85f767ef0fc7dd98cbbSergio Giro * is used for retrieving {@code Certificate}s and {@code CRL}s. The
4094c24c5bb69f6dfec482f85f767ef0fc7dd98cbbSergio Giro * {@code CertStore} that is returned is initialized with the specified
4151b1b6997fd3f980076b8081f7f1165ccc2a4008Piotr Jastrzebski * parameters. The type of parameters needed may vary between different types
4294c24c5bb69f6dfec482f85f767ef0fc7dd98cbbSergio Giro * of {@code CertStore}s.
4351b1b6997fd3f980076b8081f7f1165ccc2a4008Piotr Jastrzebski *
4451b1b6997fd3f980076b8081f7f1165ccc2a4008Piotr Jastrzebski * @see CertStore#getInstance
4551b1b6997fd3f980076b8081f7f1165ccc2a4008Piotr Jastrzebski *
4651b1b6997fd3f980076b8081f7f1165ccc2a4008Piotr Jastrzebski * @since       1.4
4751b1b6997fd3f980076b8081f7f1165ccc2a4008Piotr Jastrzebski * @author      Steve Hanna
4851b1b6997fd3f980076b8081f7f1165ccc2a4008Piotr Jastrzebski */
4951b1b6997fd3f980076b8081f7f1165ccc2a4008Piotr Jastrzebskipublic interface CertStoreParameters extends Cloneable {
5051b1b6997fd3f980076b8081f7f1165ccc2a4008Piotr Jastrzebski
5151b1b6997fd3f980076b8081f7f1165ccc2a4008Piotr Jastrzebski    /**
5294c24c5bb69f6dfec482f85f767ef0fc7dd98cbbSergio Giro     * Makes a copy of this {@code CertStoreParameters}.
5351b1b6997fd3f980076b8081f7f1165ccc2a4008Piotr Jastrzebski     * <p>
5451b1b6997fd3f980076b8081f7f1165ccc2a4008Piotr Jastrzebski     * The precise meaning of "copy" may depend on the class of
5594c24c5bb69f6dfec482f85f767ef0fc7dd98cbbSergio Giro     * the {@code CertStoreParameters} object. A typical implementation
5651b1b6997fd3f980076b8081f7f1165ccc2a4008Piotr Jastrzebski     * performs a "deep copy" of this object, but this is not an absolute
5751b1b6997fd3f980076b8081f7f1165ccc2a4008Piotr Jastrzebski     * requirement. Some implementations may perform a "shallow copy" of some
5851b1b6997fd3f980076b8081f7f1165ccc2a4008Piotr Jastrzebski     * or all of the fields of this object.
5951b1b6997fd3f980076b8081f7f1165ccc2a4008Piotr Jastrzebski     * <p>
6094c24c5bb69f6dfec482f85f767ef0fc7dd98cbbSergio Giro     * Note that the {@code CertStore.getInstance} methods make a copy
6194c24c5bb69f6dfec482f85f767ef0fc7dd98cbbSergio Giro     * of the specified {@code CertStoreParameters}. A deep copy
6294c24c5bb69f6dfec482f85f767ef0fc7dd98cbbSergio Giro     * implementation of {@code clone} is safer and more robust, as it
6394c24c5bb69f6dfec482f85f767ef0fc7dd98cbbSergio Giro     * prevents the caller from corrupting a shared {@code CertStore} by
6451b1b6997fd3f980076b8081f7f1165ccc2a4008Piotr Jastrzebski     * subsequently modifying the contents of its initialization parameters.
6594c24c5bb69f6dfec482f85f767ef0fc7dd98cbbSergio Giro     * However, a shallow copy implementation of {@code clone} is more
6651b1b6997fd3f980076b8081f7f1165ccc2a4008Piotr Jastrzebski     * appropriate for applications that need to hold a reference to a
6794c24c5bb69f6dfec482f85f767ef0fc7dd98cbbSergio Giro     * parameter contained in the {@code CertStoreParameters}. For example,
6851b1b6997fd3f980076b8081f7f1165ccc2a4008Piotr Jastrzebski     * a shallow copy clone allows an application to release the resources of
6994c24c5bb69f6dfec482f85f767ef0fc7dd98cbbSergio Giro     * a particular {@code CertStore} initialization parameter immediately,
7051b1b6997fd3f980076b8081f7f1165ccc2a4008Piotr Jastrzebski     * rather than waiting for the garbage collection mechanism. This should
7194c24c5bb69f6dfec482f85f767ef0fc7dd98cbbSergio Giro     * be done with the utmost care, since the {@code CertStore} may still
7251b1b6997fd3f980076b8081f7f1165ccc2a4008Piotr Jastrzebski     * be in use by other threads.
7351b1b6997fd3f980076b8081f7f1165ccc2a4008Piotr Jastrzebski     * <p>
7451b1b6997fd3f980076b8081f7f1165ccc2a4008Piotr Jastrzebski     * Each subclass should state the precise behavior of this method so
7551b1b6997fd3f980076b8081f7f1165ccc2a4008Piotr Jastrzebski     * that users and developers know what to expect.
7651b1b6997fd3f980076b8081f7f1165ccc2a4008Piotr Jastrzebski     *
7794c24c5bb69f6dfec482f85f767ef0fc7dd98cbbSergio Giro     * @return a copy of this {@code CertStoreParameters}
7851b1b6997fd3f980076b8081f7f1165ccc2a4008Piotr Jastrzebski     */
7951b1b6997fd3f980076b8081f7f1165ccc2a4008Piotr Jastrzebski    Object clone();
8051b1b6997fd3f980076b8081f7f1165ccc2a4008Piotr Jastrzebski}
81