KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * @(#)CertPathHelperImpl.java 1.4 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.*;
11
12 import javax.security.auth.x500.X500Principal JavaDoc;
13
14 import sun.security.provider.certpath.CertPathHelper;
15
16 import sun.security.x509.GeneralNameInterface;
17
18 /**
19  * Helper class that allows the Sun CertPath provider to access
20  * implementation dependent APIs in CertPath framework.
21  *
22  * @author Andreas Sterbenz
23  * @version 1.4, 12/19/03
24  */

25 class CertPathHelperImpl extends CertPathHelper {
26     
27     private CertPathHelperImpl() {
28     // empty
29
}
30     
31     /**
32      * Initialize the helper framework. This method must be called from
33      * the static initializer of each class that is the target of one of
34      * the methods in this class. This ensures that the helper if initialized
35      * prior to a tunneled call from the Sun provider.
36      */

37     synchronized static void initialize() {
38     if (CertPathHelper.instance == null) {
39         CertPathHelper.instance = new CertPathHelperImpl JavaDoc();
40     }
41     }
42     
43     protected void implSetSubject(X509CertSelector JavaDoc sel, X500Principal JavaDoc subject) {
44     sel.setSubject(subject);
45     }
46
47     protected X500Principal JavaDoc implGetSubject(X509CertSelector JavaDoc sel) {
48     return sel.getSubject();
49     }
50     
51     protected void implSetIssuer(X509CertSelector JavaDoc sel, X500Principal JavaDoc issuer) {
52     sel.setIssuer(issuer);
53     }
54
55     protected X500Principal JavaDoc implGetIssuer(X509CertSelector JavaDoc sel) {
56     return sel.getIssuer();
57     }
58     
59     protected X500Principal JavaDoc implGetCA(TrustAnchor JavaDoc anchor) {
60     return anchor.getCA();
61     }
62     
63     protected void implSetPathToNames(X509CertSelector JavaDoc sel,
64         Set<GeneralNameInterface> names) {
65     sel.setPathToNamesInternal(names);
66     }
67
68     protected void implAddIssuer(X509CRLSelector JavaDoc sel, X500Principal JavaDoc name) {
69     sel.addIssuer(name);
70     }
71
72     protected Collection<X500Principal JavaDoc> implGetIssuers(X509CRLSelector JavaDoc sel) {
73     return sel.getIssuers();
74     }
75     
76 }
77
78
Popular Tags