4 * @brief Interface of crl_t.
9 * Copyright (C) 2006 Andreas Steffen
10 * Hochschule fuer Technik Rapperswil
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the
14 * Free Software Foundation; either version 2 of the License, or (at your
15 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
19 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
26 typedef struct crl_t crl_t
;
29 #include <crypto/rsa/rsa_public_key.h>
30 #include <crypto/certinfo.h>
31 #include <utils/identification.h>
32 #include <utils/iterator.h>
35 * @brief X.509 certificate revocation list
38 * - crl_create_from_chunk()
39 * - crl_create_from_file()
46 * @brief Get the crl's issuer ID.
48 * The resulting ID is always a identification_t
49 * of type ID_DER_ASN1_DN.
51 * @param this calling object
54 identification_t
*(*get_issuer
) (const crl_t
*this);
57 * @brief Check if both crls have the same issuer.
59 * @param this calling object
60 * @param other other crl
61 * @return TRUE if the same issuer
63 bool (*equals_issuer
) (const crl_t
*this, const crl_t
*other
);
66 * @brief Check if ia candidate cert is the issuer of the crl
68 * @param this calling object
69 * @param issuer candidate issuer of the crl
70 * @return TRUE if issuer
72 bool (*is_issuer
) (const crl_t
*this, const x509_t
*issuer
);
75 * @brief Checks the validity interval of the crl
77 * @param this calling object
78 * @param until until = min(until, nextUpdate) if strict == TRUE
79 * @param strict nextUpdate restricts the validity
80 * @return NULL if the crl is valid
82 err_t (*is_valid
) (const crl_t
*this, time_t *until
, bool strict
);
85 * @brief Checks if this crl is newer (thisUpdate) than the other crl
87 * @param this calling object
88 * @param other other crl object
89 * @return TRUE if this was issued more recently than other
91 bool (*is_newer
) (const crl_t
*this, const crl_t
*other
);
94 * @brief Check if a crl is trustworthy.
96 * @param this calling object
97 * @param signer signer's RSA public key
98 * @return TRUE if crl is trustworthy
100 bool (*verify
) (const crl_t
*this, const rsa_public_key_t
*signer
);
103 * @brief Get the certificate status
105 * @param this calling object
106 * @param certinfo certinfo is updated
108 void (*get_status
) (const crl_t
*this, certinfo_t
*certinfo
);
111 * @brief Destroys the crl.
113 * @param this crl to destroy
115 void (*destroy
) (crl_t
*this);
119 * @brief Read a x509 crl from a DER encoded blob.
121 * @param chunk chunk containing DER encoded data
122 * @return created crl_t, or NULL if invalid.
124 * @ingroup transforms
126 crl_t
*crl_create_from_chunk(chunk_t chunk
);
129 * @brief Read a x509 crl from a DER encoded file.
131 * @param filename file containing DER encoded data
132 * @return created crl_t, or NULL if invalid.
134 * @ingroup transforms
136 crl_t
*crl_create_from_file(const char *filename
);