173405ff8729cca39da90b2e2f604062e323f6f7aKenny Root/*
273405ff8729cca39da90b2e2f604062e323f6f7aKenny Root * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
373405ff8729cca39da90b2e2f604062e323f6f7aKenny Root * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
473405ff8729cca39da90b2e2f604062e323f6f7aKenny Root *
573405ff8729cca39da90b2e2f604062e323f6f7aKenny Root * This code is free software; you can redistribute it and/or modify it
673405ff8729cca39da90b2e2f604062e323f6f7aKenny Root * under the terms of the GNU General Public License version 2 only, as
773405ff8729cca39da90b2e2f604062e323f6f7aKenny Root * published by the Free Software Foundation.  Oracle designates this
873405ff8729cca39da90b2e2f604062e323f6f7aKenny Root * particular file as subject to the "Classpath" exception as provided
973405ff8729cca39da90b2e2f604062e323f6f7aKenny Root * by Oracle in the LICENSE file that accompanied this code.
1073405ff8729cca39da90b2e2f604062e323f6f7aKenny Root *
1173405ff8729cca39da90b2e2f604062e323f6f7aKenny Root * This code is distributed in the hope that it will be useful, but WITHOUT
1273405ff8729cca39da90b2e2f604062e323f6f7aKenny Root * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1373405ff8729cca39da90b2e2f604062e323f6f7aKenny Root * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
1473405ff8729cca39da90b2e2f604062e323f6f7aKenny Root * version 2 for more details (a copy is included in the LICENSE file that
1573405ff8729cca39da90b2e2f604062e323f6f7aKenny Root * accompanied this code).
1673405ff8729cca39da90b2e2f604062e323f6f7aKenny Root *
1773405ff8729cca39da90b2e2f604062e323f6f7aKenny Root * You should have received a copy of the GNU General Public License version
1873405ff8729cca39da90b2e2f604062e323f6f7aKenny Root * 2 along with this work; if not, write to the Free Software Foundation,
1973405ff8729cca39da90b2e2f604062e323f6f7aKenny Root * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
2073405ff8729cca39da90b2e2f604062e323f6f7aKenny Root *
2173405ff8729cca39da90b2e2f604062e323f6f7aKenny Root * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2273405ff8729cca39da90b2e2f604062e323f6f7aKenny Root * or visit www.oracle.com if you need additional information or have any
2373405ff8729cca39da90b2e2f604062e323f6f7aKenny Root * questions.
2473405ff8729cca39da90b2e2f604062e323f6f7aKenny Root */
2573405ff8729cca39da90b2e2f604062e323f6f7aKenny Root
2673405ff8729cca39da90b2e2f604062e323f6f7aKenny Rootpackage sun.security.provider.certpath;
2773405ff8729cca39da90b2e2f604062e323f6f7aKenny Root
2873405ff8729cca39da90b2e2f604062e323f6f7aKenny Rootimport java.io.IOException;
2973405ff8729cca39da90b2e2f604062e323f6f7aKenny Rootimport java.security.cert.CertificateException;
3073405ff8729cca39da90b2e2f604062e323f6f7aKenny Rootimport java.security.cert.X509Certificate;
3173405ff8729cca39da90b2e2f604062e323f6f7aKenny Rootimport java.security.cert.CertPathValidatorException;
3273405ff8729cca39da90b2e2f604062e323f6f7aKenny Root
3373405ff8729cca39da90b2e2f604062e323f6f7aKenny Root/**
3473405ff8729cca39da90b2e2f604062e323f6f7aKenny Root * A specification of a PKIX validation state
3573405ff8729cca39da90b2e2f604062e323f6f7aKenny Root * which is initialized by each build and updated each time a
3673405ff8729cca39da90b2e2f604062e323f6f7aKenny Root * certificate is added to the current path.
3773405ff8729cca39da90b2e2f604062e323f6f7aKenny Root *
3873405ff8729cca39da90b2e2f604062e323f6f7aKenny Root * @since       1.4
3973405ff8729cca39da90b2e2f604062e323f6f7aKenny Root * @author      Sean Mullan
4073405ff8729cca39da90b2e2f604062e323f6f7aKenny Root * @author      Yassir Elley
4173405ff8729cca39da90b2e2f604062e323f6f7aKenny Root */
4273405ff8729cca39da90b2e2f604062e323f6f7aKenny Root
4373405ff8729cca39da90b2e2f604062e323f6f7aKenny Rootinterface State extends Cloneable {
4473405ff8729cca39da90b2e2f604062e323f6f7aKenny Root
4573405ff8729cca39da90b2e2f604062e323f6f7aKenny Root    /**
4673405ff8729cca39da90b2e2f604062e323f6f7aKenny Root     * Update the state with the next certificate added to the path.
4773405ff8729cca39da90b2e2f604062e323f6f7aKenny Root     *
4873405ff8729cca39da90b2e2f604062e323f6f7aKenny Root     * @param cert the certificate which is used to update the state
4973405ff8729cca39da90b2e2f604062e323f6f7aKenny Root     */
5073405ff8729cca39da90b2e2f604062e323f6f7aKenny Root    public void updateState(X509Certificate cert)
5173405ff8729cca39da90b2e2f604062e323f6f7aKenny Root        throws CertificateException, IOException, CertPathValidatorException;
5273405ff8729cca39da90b2e2f604062e323f6f7aKenny Root
5373405ff8729cca39da90b2e2f604062e323f6f7aKenny Root    /**
5473405ff8729cca39da90b2e2f604062e323f6f7aKenny Root     * Creates and returns a copy of this object
5573405ff8729cca39da90b2e2f604062e323f6f7aKenny Root     */
5673405ff8729cca39da90b2e2f604062e323f6f7aKenny Root    public Object clone();
5773405ff8729cca39da90b2e2f604062e323f6f7aKenny Root
5873405ff8729cca39da90b2e2f604062e323f6f7aKenny Root    /**
5973405ff8729cca39da90b2e2f604062e323f6f7aKenny Root     * Returns a boolean flag indicating if the state is initial
6073405ff8729cca39da90b2e2f604062e323f6f7aKenny Root     * (just starting)
6173405ff8729cca39da90b2e2f604062e323f6f7aKenny Root     *
6273405ff8729cca39da90b2e2f604062e323f6f7aKenny Root     * @return boolean flag indicating if the state is initial (just starting)
6373405ff8729cca39da90b2e2f604062e323f6f7aKenny Root     */
6473405ff8729cca39da90b2e2f604062e323f6f7aKenny Root    public boolean isInitial();
6573405ff8729cca39da90b2e2f604062e323f6f7aKenny Root
6673405ff8729cca39da90b2e2f604062e323f6f7aKenny Root    /**
6773405ff8729cca39da90b2e2f604062e323f6f7aKenny Root     * Returns a boolean flag indicating if a key lacking necessary key
6873405ff8729cca39da90b2e2f604062e323f6f7aKenny Root     * algorithm parameters has been encountered.
6973405ff8729cca39da90b2e2f604062e323f6f7aKenny Root     *
7073405ff8729cca39da90b2e2f604062e323f6f7aKenny Root     * @return boolean flag indicating if key lacking parameters encountered.
7173405ff8729cca39da90b2e2f604062e323f6f7aKenny Root     */
7273405ff8729cca39da90b2e2f604062e323f6f7aKenny Root    public boolean keyParamsNeeded();
7373405ff8729cca39da90b2e2f604062e323f6f7aKenny Root}
74