4 * @brief Interface of certinfo_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 enum cert_status_t cert_status_t
;
27 typedef enum crl_reason_t crl_reason_t
;
28 typedef struct certinfo_t certinfo_t
;
33 * RFC 2560 OCSP - certificate status
40 CERT_UNTRUSTED
= 4 /* private use */
43 extern enum_name_t
*cert_status_names
;
46 * RFC 2459 CRL reason codes
49 REASON_UNSPECIFIED
= 0,
50 REASON_KEY_COMPROMISE
= 1,
51 REASON_CA_COMPROMISE
= 2,
52 REASON_AFFILIATION_CHANGED
= 3,
53 REASON_SUPERSEDED
= 4,
54 REASON_CESSATION_OF_OPERATON
= 5,
55 REASON_CERTIFICATE_HOLD
= 6,
56 REASON_REMOVE_FROM_CRL
= 8
59 extern enum_name_t
*crl_reason_names
;
62 * @brief X.509 certificate status information
69 * @brief Check if both certinfo objects have the same serialNumber.
71 * @param this calling object
72 * @param that second certinfo_t object
73 * @return TRUE if the same serialNumber
75 bool (*equals_serialNumber
) (const certinfo_t
*this, const certinfo_t
*that
);
79 * @brief Get serial number.
81 * @param this calling object
82 * @return serialNumber
84 chunk_t (*get_serialNumber
) (const certinfo_t
*this);
87 * @brief Set certificate status.
89 * @param this calling object
90 * @param status status
92 void (*set_status
) (certinfo_t
*this, cert_status_t status
);
95 * @brief Get certificate status.
97 * @param this calling object
100 cert_status_t (*get_status
) (const certinfo_t
*this);
103 * @brief Set nextUpdate.
105 * @param this calling object
108 void (*set_nextUpdate
) (certinfo_t
*this, time_t nextUpdate
);
111 * @brief Get nextUpdate.
113 * @param this calling object
116 time_t (*get_nextUpdate
) (const certinfo_t
*this);
119 * @brief Set revocationTime.
121 * @param this calling object
122 * @param revocationTime revocationTime
124 void (*set_revocationTime
) (certinfo_t
*this, time_t revocationTime
);
127 * @brief Get revocationTime.
129 * @param this calling object
130 * @return revocationTime
132 time_t (*get_revocationTime
) (const certinfo_t
*this);
135 * @brief Set revocationReason.
137 * @param this calling object
138 * @param reason revocationReason
140 void (*set_revocationReason
) (certinfo_t
*this, crl_reason_t reason
);
143 * @brief Get revocationReason.
145 * @param this calling object
146 * @return revocationReason
148 crl_reason_t (*get_revocationReason
) (const certinfo_t
*this);
151 * @brief Destroys the certinfo_t object.
153 * @param this crl to destroy
155 void (*destroy
) (certinfo_t
*this);
160 * @brief Create a certinfo_t object.
162 * @param serial chunk serial number of the certificate
163 * @return created certinfo_t object
165 * @ingroup transforms
167 certinfo_t
*certinfo_create(chunk_t serial
);
169 #endif /* CERTINFO_H_ */