Source Code Cross Referenced for PKIXCertPathValidatorResult.java in  » 6.0-JDK-Core » security » java » security » cert » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
Java Source Code / Java Documentation
1.6.0 JDK Core
2.6.0 JDK Modules
3.6.0 JDK Modules com.sun
4.6.0 JDK Modules com.sun.java
5.6.0 JDK Modules sun
6.6.0 JDK Platform
7.Ajax
8.Apache Harmony Java SE
9.Aspect oriented
10.Authentication Authorization
11.Blogger System
12.Build
13.Byte Code
14.Cache
15.Chart
16.Chat
17.Code Analyzer
18.Collaboration
19.Content Management System
20.Database Client
21.Database DBMS
22.Database JDBC Connection Pool
23.Database ORM
24.Development
25.EJB Server
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » security » java.security.cert 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001        /*
002         * Copyright 2000-2001 Sun Microsystems, Inc.  All Rights Reserved.
003         * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004         *
005         * This code is free software; you can redistribute it and/or modify it
006         * under the terms of the GNU General Public License version 2 only, as
007         * published by the Free Software Foundation.  Sun designates this
008         * particular file as subject to the "Classpath" exception as provided
009         * by Sun in the LICENSE file that accompanied this code.
010         *
011         * This code is distributed in the hope that it will be useful, but WITHOUT
012         * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013         * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
014         * version 2 for more details (a copy is included in the LICENSE file that
015         * accompanied this code).
016         *
017         * You should have received a copy of the GNU General Public License version
018         * 2 along with this work; if not, write to the Free Software Foundation,
019         * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020         *
021         * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022         * CA 95054 USA or visit www.sun.com if you need additional information or
023         * have any questions.
024         */
025
026        package java.security.cert;
027
028        import java.security.PublicKey;
029
030        /**
031         * This class represents the successful result of the PKIX certification 
032         * path validation algorithm. 
033         *
034         * <p>Instances of <code>PKIXCertPathValidatorResult</code> are returned by the 
035         * {@link CertPathValidator#validate validate} method of 
036         * <code>CertPathValidator</code> objects implementing the PKIX algorithm.
037         *
038         * <p> All <code>PKIXCertPathValidatorResult</code> objects contain the 
039         * valid policy tree and subject public key resulting from the 
040         * validation algorithm, as well as a <code>TrustAnchor</code> describing
041         * the certification authority (CA) that served as a trust anchor for the 
042         * certification path.
043         * <p>
044         * <b>Concurrent Access</b>
045         * <p>
046         * Unless otherwise specified, the methods defined in this class are not
047         * thread-safe. Multiple threads that need to access a single
048         * object concurrently should synchronize amongst themselves and
049         * provide the necessary locking. Multiple threads each manipulating
050         * separate objects need not synchronize.
051         *
052         * @see CertPathValidatorResult
053         *
054         * @version 	1.16 05/05/07
055         * @since	1.4
056         * @author	Yassir Elley
057         * @author	Sean Mullan
058         */
059        public class PKIXCertPathValidatorResult implements 
060                CertPathValidatorResult {
061
062            private TrustAnchor trustAnchor;
063            private PolicyNode policyTree;
064            private PublicKey subjectPublicKey;
065
066            /**
067             * Creates an instance of <code>PKIXCertPathValidatorResult</code>
068             * containing the specified parameters. 
069             * 
070             * @param trustAnchor a <code>TrustAnchor</code> describing the CA that 
071             * served as a trust anchor for the certification path
072             * @param policyTree the immutable valid policy tree, or <code>null</code> 
073             * if there are no valid policies
074             * @param subjectPublicKey the public key of the subject
075             * @throws NullPointerException if the <code>subjectPublicKey</code> or
076             * <code>trustAnchor</code> parameters are <code>null</code>
077             */
078            public PKIXCertPathValidatorResult(TrustAnchor trustAnchor,
079                    PolicyNode policyTree, PublicKey subjectPublicKey) {
080                if (subjectPublicKey == null)
081                    throw new NullPointerException(
082                            "subjectPublicKey must be non-null");
083                if (trustAnchor == null)
084                    throw new NullPointerException(
085                            "trustAnchor must be non-null");
086                this .trustAnchor = trustAnchor;
087                this .policyTree = policyTree;
088                this .subjectPublicKey = subjectPublicKey;
089            }
090
091            /**
092             * Returns the <code>TrustAnchor</code> describing the CA that served
093             * as a trust anchor for the certification path.
094             *
095             * @return the <code>TrustAnchor</code> (never <code>null</code>)
096             */
097            public TrustAnchor getTrustAnchor() {
098                return trustAnchor;
099            }
100
101            /**
102             * Returns the root node of the valid policy tree resulting from the 
103             * PKIX certification path validation algorithm. The 
104             * <code>PolicyNode</code> object that is returned and any objects that 
105             * it returns through public methods are immutable.
106             *
107             * <p>Most applications will not need to examine the valid policy tree.
108             * They can achieve their policy processing goals by setting the
109             * policy-related parameters in <code>PKIXParameters</code>. However, more
110             * sophisticated applications, especially those that process policy
111             * qualifiers, may need to traverse the valid policy tree using the
112             * {@link PolicyNode#getParent PolicyNode.getParent} and 
113             * {@link PolicyNode#getChildren PolicyNode.getChildren} methods.
114             * 
115             * @return the root node of the valid policy tree, or <code>null</code> 
116             * if there are no valid policies
117             */
118            public PolicyNode getPolicyTree() {
119                return policyTree;
120            }
121
122            /**
123             * Returns the public key of the subject (target) of the certification
124             * path, including any inherited public key parameters if applicable. 
125             *
126             * @return the public key of the subject (never <code>null</code>)
127             */
128            public PublicKey getPublicKey() {
129                return subjectPublicKey;
130            }
131
132            /**
133             * Returns a copy of this object.
134             *
135             * @return the copy
136             */
137            public Object clone() {
138                try {
139                    return super .clone();
140                } catch (CloneNotSupportedException e) {
141                    /* Cannot happen */
142                    throw new InternalError(e.toString());
143                }
144            }
145
146            /**
147             * Return a printable representation of this 
148             * <code>PKIXCertPathValidatorResult</code>.
149             *
150             * @return a <code>String</code> describing the contents of this
151             *         <code>PKIXCertPathValidatorResult</code>
152             */
153            public String toString() {
154                StringBuffer sb = new StringBuffer();
155                sb.append("PKIXCertPathValidatorResult: [\n");
156                sb.append("  Trust Anchor: " + trustAnchor.toString() + "\n");
157                sb
158                        .append("  Policy Tree: " + String.valueOf(policyTree)
159                                + "\n");
160                sb.append("  Subject Public Key: " + subjectPublicKey + "\n");
161                sb.append("]");
162                return sb.toString();
163            }
164        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.