1 /* 2 * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. Oracle designates this 8 * particular file as subject to the "Classpath" exception as provided 9 * by Oracle in the LICENSE file that accompanied this code. 10 * 11 * This code is distributed in the hope that it will be useful, but WITHOUT 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 * version 2 for more details (a copy is included in the LICENSE file that 15 * accompanied this code). 16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 package sun.security.provider.certpath; 27 28 import sun.security.util.Debug; 29 import java.security.PublicKey; 30 import java.security.cert.CertPath; 31 import java.security.cert.PKIXCertPathBuilderResult; 32 import java.security.cert.PolicyNode; 33 import java.security.cert.TrustAnchor; 34 35 /** 36 * This class represents the result of a SunCertPathBuilder build. 37 * Since all paths returned by the SunCertPathProvider are PKIX validated 38 * the result contains the valid policy tree and subject public key returned 39 * by the algorithm. It also contains the trust anchor and debug information 40 * represented in the form of an adjacency list. 41 * 42 * @see PKIXCertPathBuilderResult 43 * 44 * @since 1.4 45 * @author Sean Mullan 46 */ 47 //@@@ Note: this class is not in public API and access to adjacency list is 48 //@@@ intended for debugging/replay of Sun PKIX CertPathBuilder implementation. 49 50 public class SunCertPathBuilderResult extends PKIXCertPathBuilderResult { 51 52 private static final Debug debug = Debug.getInstance("certpath"); 53 54 private AdjacencyList adjList; 55 56 /** 57 * Creates a SunCertPathBuilderResult instance. 58 * 59 * @param certPath the validated <code>CertPath</code> 60 * @param trustAnchor a <code>TrustAnchor</code> describing the CA that 61 * served as a trust anchor for the certification path 62 * @param policyTree the valid policy tree, or <code>null</code> 63 * if there are no valid policies 64 * @param subjectPublicKey the public key of the subject 65 * @param adjList an Adjacency list containing debug information 66 */ SunCertPathBuilderResult(CertPath certPath, TrustAnchor trustAnchor, PolicyNode policyTree, PublicKey subjectPublicKey, AdjacencyList adjList)67 SunCertPathBuilderResult(CertPath certPath, 68 TrustAnchor trustAnchor, PolicyNode policyTree, 69 PublicKey subjectPublicKey, AdjacencyList adjList) 70 { 71 super(certPath, trustAnchor, policyTree, subjectPublicKey); 72 this.adjList = adjList; 73 } 74 75 /** 76 * Returns the adjacency list containing information about the build. 77 * 78 * @return The adjacency list containing information about the build. 79 */ getAdjacencyList()80 public AdjacencyList getAdjacencyList() { 81 return adjList; 82 } 83 } 84