1. /*
  2. * @(#)CertPathHelperImpl.java 1.2 03/01/23
  3. *
  4. * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package java.security.cert;
  8. import java.util.*;
  9. import javax.security.auth.x500.X500Principal;
  10. import sun.security.provider.certpath.CertPathHelper;
  11. /**
  12. * Helper class that allows the Sun CertPath provider to access
  13. * implementation dependent APIs in CertPath framework.
  14. *
  15. * @author Andreas Sterbenz
  16. * @version 1.2, 01/23/03
  17. */
  18. class CertPathHelperImpl extends CertPathHelper {
  19. private CertPathHelperImpl() {
  20. // empty
  21. }
  22. /**
  23. * Initialize the helper framework. This method must be called from
  24. * the static initializer of each class that is the target of one of
  25. * the methods in this class. This ensures that the helper if initialized
  26. * prior to a tunneled call from the Sun provider.
  27. */
  28. synchronized static void initialize() {
  29. if (CertPathHelper.instance == null) {
  30. CertPathHelper.instance = new CertPathHelperImpl();
  31. }
  32. }
  33. protected void implSetSubject(X509CertSelector sel, X500Principal subject) {
  34. sel.setSubject(subject);
  35. }
  36. protected X500Principal implGetSubject(X509CertSelector sel) {
  37. return sel.getSubject();
  38. }
  39. protected void implSetIssuer(X509CertSelector sel, X500Principal issuer) {
  40. sel.setIssuer(issuer);
  41. }
  42. protected X500Principal implGetIssuer(X509CertSelector sel) {
  43. return sel.getIssuer();
  44. }
  45. protected X500Principal implGetCA(TrustAnchor anchor) {
  46. return anchor.getCA();
  47. }
  48. protected void implSetPathToNames(X509CertSelector sel, Set names) {
  49. sel.setPathToNamesInternal(names);
  50. }
  51. protected void implAddIssuer(X509CRLSelector sel, X500Principal name) {
  52. sel.addIssuer(name);
  53. }
  54. protected Collection implGetIssuers(X509CRLSelector sel) {
  55. return sel.getIssuers();
  56. }
  57. }