1/*
2 *  Licensed to the Apache Software Foundation (ASF) under one or more
3 *  contributor license agreements.  See the NOTICE file distributed with
4 *  this work for additional information regarding copyright ownership.
5 *  The ASF licenses this file to You under the Apache License, Version 2.0
6 *  (the "License"); you may not use this file except in compliance with
7 *  the License.  You may obtain a copy of the License at
8 *
9 *     http://www.apache.org/licenses/LICENSE-2.0
10 *
11 *  Unless required by applicable law or agreed to in writing, software
12 *  distributed under the License is distributed on an "AS IS" BASIS,
13 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 *  See the License for the specific language governing permissions and
15 *  limitations under the License.
16 */
17
18package java.security.cert;
19
20import java.util.Iterator;
21import java.util.Set;
22
23/**
24 * The interface to a valid policy tree node for the PKIX certification path
25 * validation algorithm.
26 * <p>
27 * Instances of this class are one of the outputs of the PKIX certification path
28 * validation algorithm.
29 */
30public interface PolicyNode {
31
32    /**
33     * Returns the list of children of this node as an {@code Iterator}.
34     *
35     * @return the list of children of this node as an {@code Iterator}.
36     */
37    public Iterator<? extends PolicyNode> getChildren();
38
39    /**
40     * Returns the depth of this node in the policy tree.
41     * <p>
42     * the depth is zero based.
43     *
44     * @return the depth of this node in the policy tree.
45     */
46    public int getDepth();
47
48    /**
49     * Returns the expected policies for the next certificate to be valid.
50     *
51     * @return the expected policies.
52     */
53    public Set<String> getExpectedPolicies();
54
55    /**
56     * Returns the parent policy node.
57     *
58     * @return the parent policy node.
59     */
60    public PolicyNode getParent();
61
62    /**
63     * Returns the policy qualifiers associated with the policy of this node.
64     *
65     * @return the policy qualifiers associated with the policy of this node.
66     */
67    public Set<? extends PolicyQualifierInfo> getPolicyQualifiers();
68
69    /**
70     * Returns the valid policy of this node.
71     *
72     * @return the valid policy of this node.
73     */
74    public String getValidPolicy();
75
76    /**
77     * Returns whether the certificate policy extension of the most recently
78     * processed certificate is marked as critical.
79     *
80     * @return {@code true} if the extension is marked as critical, otherwise
81     *         {@code false}.
82     */
83    public boolean isCritical();
84}
85