KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > java > security > cert > PolicyNode


1 /*
2  * @(#)PolicyNode.java 1.9 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package java.security.cert;
9
10 import java.util.Iterator JavaDoc;
11 import java.util.Set JavaDoc;
12
13 /**
14  * An immutable valid policy tree node as defined by the PKIX certification
15  * path validation algorithm.
16  *
17  * <p>One of the outputs of the PKIX certification path validation
18  * algorithm is a valid policy tree, which includes the policies that
19  * were determined to be valid, how this determination was reached,
20  * and any policy qualifiers encountered. This tree is of depth
21  * <i>n</i>, where <i>n</i> is the length of the certification
22  * path that has been validated.
23  *
24  * <p>Most applications will not need to examine the valid policy tree.
25  * They can achieve their policy processing goals by setting the
26  * policy-related parameters in <code>PKIXParameters</code>. However,
27  * the valid policy tree is available for more sophisticated applications,
28  * especially those that process policy qualifiers.
29  *
30  * <p>{@link PKIXCertPathValidatorResult#getPolicyTree()
31  * PKIXCertPathValidatorResult.getPolicyTree} returns the root node of the
32  * valid policy tree. The tree can be traversed using the
33  * {@link #getChildren getChildren} and {@link #getParent getParent} methods.
34  * Data about a particular node can be retrieved using other methods of
35  * <code>PolicyNode</code>.
36  *
37  * <p><b>Concurrent Access</b>
38  * <p>All <code>PolicyNode</code> objects must be immutable and
39  * thread-safe. Multiple threads may concurrently invoke the methods defined
40  * in this class on a single <code>PolicyNode</code> object (or more than one)
41  * with no ill effects. This stipulation applies to all public fields and
42  * methods of this class and any added or overridden by subclasses.
43  *
44  * @version 1.9 12/19/03
45  * @since 1.4
46  * @author Sean Mullan
47  */

48 public interface PolicyNode {
49
50     /**
51      * Returns the parent of this node, or <code>null</code> if this is the
52      * root node.
53      *
54      * @return the parent of this node, or <code>null</code> if this is the
55      * root node
56      */

57     PolicyNode JavaDoc getParent();
58
59     /**
60      * Returns an iterator over the children of this node. Any attempts to
61      * modify the children of this node through the
62      * <code>Iterator</code>'s remove method must throw an
63      * <code>UnsupportedOperationException</code>.
64      *
65      * @return an iterator over the children of this node
66      */

67     Iterator JavaDoc<? extends PolicyNode JavaDoc> getChildren();
68
69     /**
70      * Returns the depth of this node in the valid policy tree.
71      *
72      * @return the depth of this node (0 for the root node, 1 for its
73      * children, and so on)
74      */

75     int getDepth();
76
77     /**
78      * Returns the valid policy represented by this node.
79      *
80      * @return the <code>String</code> OID of the valid policy
81      * represented by this node, or the special value "any-policy". For
82      * the root node, this method always returns the special value "any-policy".
83      */

84     String JavaDoc getValidPolicy();
85
86     /**
87      * Returns the set of policy qualifiers associated with the
88      * valid policy represented by this node.
89      *
90      * @return an immutable <code>Set</code> of
91      * <code>PolicyQualifierInfo</code>s. For the root node, this
92      * is always an empty <code>Set</code>.
93      */

94     Set JavaDoc<? extends PolicyQualifierInfo JavaDoc> getPolicyQualifiers();
95
96     /**
97      * Returns the set of expected policies that would satisfy this
98      * node's valid policy in the next certificate to be processed.
99      *
100      * @return an immutable <code>Set</code> of expected policy
101      * <code>String</code> OIDs, or an immutable <code>Set</code> with
102      * the single special value "any-policy". For the root node, this method
103      * always returns a <code>Set</code> with the single value "any-policy".
104      */

105     Set JavaDoc<String JavaDoc> getExpectedPolicies();
106
107     /**
108      * Returns the criticality indicator of the certificate policy extension
109      * in the most recently processed certificate.
110      *
111      * @return <code>true</code> if extension marked critical,
112      * <code>false</code> otherwise. For the root node, <code>false</code>
113      * is always returned.
114      */

115     boolean isCritical();
116 }
117
Popular Tags