01 /*
02 * Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved.
03 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
04 *
05 * This code is free software; you can redistribute it and/or modify it
06 * under the terms of the GNU General Public License version 2 only, as
07 * published by the Free Software Foundation. Sun designates this
08 * particular file as subject to the "Classpath" exception as provided
09 * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22 * CA 95054 USA or visit www.sun.com if you need additional information or
23 * have any questions.
24 */
25
26 package java.security.cert;
27
28 /**
29 * This class is an abstraction of certificate revocation lists (CRLs) that
30 * have different formats but important common uses. For example, all CRLs
31 * share the functionality of listing revoked certificates, and can be queried
32 * on whether or not they list a given certificate.
33 * <p>
34 * Specialized CRL types can be defined by subclassing off of this abstract
35 * class.
36 *
37 * @author Hemma Prafullchandra
38 *
39 * @version 1.20, 05/05/07
40 *
41 * @see X509CRL
42 * @see CertificateFactory
43 *
44 * @since 1.2
45 */
46
47 public abstract class CRL {
48
49 // the CRL type
50 private String type;
51
52 /**
53 * Creates a CRL of the specified type.
54 *
55 * @param type the standard name of the CRL type.
56 * See Appendix A in the <a href=
57 * "../../../../technotes/guides/security/crypto/CryptoSpec.html#AppA">
58 * Java Cryptography Architecture API Specification & Reference </a>
59 * for information about standard CRL types.
60 */
61 protected CRL(String type) {
62 this .type = type;
63 }
64
65 /**
66 * Returns the type of this CRL.
67 *
68 * @return the type of this CRL.
69 */
70 public final String getType() {
71 return this .type;
72 }
73
74 /**
75 * Returns a string representation of this CRL.
76 *
77 * @return a string representation of this CRL.
78 */
79 public abstract String toString();
80
81 /**
82 * Checks whether the given certificate is on this CRL.
83 *
84 * @param cert the certificate to check for.
85 * @return true if the given certificate is on this CRL,
86 * false otherwise.
87 */
88 public abstract boolean isRevoked(Certificate cert);
89 }
|