1. /*
  2. * @(#)CRL.java 1.11 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. /**
  9. * This class is an abstraction of certificate revocation lists (CRLs) that
  10. * have different formats but important common uses. For example, all CRLs
  11. * share the functionality of listing revoked certificates, and can be queried
  12. * on whether or not they list a given certificate.
  13. * <p>
  14. * Specialized CRL types can be defined by subclassing off of this abstract
  15. * class.
  16. *
  17. * @author Hemma Prafullchandra
  18. *
  19. * @version 1.11, 01/23/03
  20. *
  21. * @see X509CRL
  22. * @see CertificateFactory
  23. *
  24. * @since 1.2
  25. */
  26. public abstract class CRL {
  27. // the CRL type
  28. private String type;
  29. /**
  30. * Creates a CRL of the specified type.
  31. *
  32. * @param type the standard name of the CRL type.
  33. * See Appendix A in the <a href=
  34. * "../../../../guide/security/CryptoSpec.html#AppA">
  35. * Java Cryptography Architecture API Specification & Reference </a>
  36. * for information about standard CRL types.
  37. */
  38. protected CRL(String type) {
  39. this.type = type;
  40. }
  41. /**
  42. * Returns the type of this CRL.
  43. *
  44. * @return the type of this CRL.
  45. */
  46. public final String getType() {
  47. return this.type;
  48. }
  49. /**
  50. * Returns a string representation of this CRL.
  51. *
  52. * @return a string representation of this CRL.
  53. */
  54. public abstract String toString();
  55. /**
  56. * Checks whether the given certificate is on this CRL.
  57. *
  58. * @param cert the certificate to check for.
  59. * @return true if the given certificate is on this CRL,
  60. * false otherwise.
  61. */
  62. public abstract boolean isRevoked(Certificate cert);
  63. }