1/*
2 *  Licensed to the Apache Software Foundation (ASF) under one or more
3 *  contributor license agreements.  See the NOTICE file distributed with
4 *  this work for additional information regarding copyright ownership.
5 *  The ASF licenses this file to You under the Apache License, Version 2.0
6 *  (the "License"); you may not use this file except in compliance with
7 *  the License.  You may obtain a copy of the License at
8 *
9 *     http://www.apache.org/licenses/LICENSE-2.0
10 *
11 *  Unless required by applicable law or agreed to in writing, software
12 *  distributed under the License is distributed on an "AS IS" BASIS,
13 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 *  See the License for the specific language governing permissions and
15 *  limitations under the License.
16 */
17
18package java.security.cert;
19
20/**
21 * This class represents Certificate Revocation Lists (CRLs) maintained by a
22 * certificate authority. They are used to indicate that a given Certificate has
23 * expired and consequently has become invalid.
24 *
25 * @see CertificateFactory
26 */
27public abstract class CRL {
28    // The CRL type
29    private final String type;
30
31    /**
32     * Creates a new certificate revocation list of the specified type.
33     *
34     * @param type
35     *            the type for the CRL.
36     */
37    protected CRL(String type) {
38        this.type = type;
39    }
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 type;
48    }
49
50    /**
51     * Returns whether the specified certificate is revoked by this CRL.
52     *
53     * @param cert
54     *            the certificate to check.
55     * @return {@code true} if the certificate is revoked by this CRL, otherwise
56     *         {@code false}.
57     */
58    public abstract boolean isRevoked(Certificate cert);
59
60    /**
61     * Returns the string representation of this instance.
62     *
63     * @return the string representation of this instance.
64     */
65    public abstract String toString();
66}
67