comparison libpurple/certificate.c @ 19012:b1090cbfc286

- Add expiration/activation functions for Certificates
author William Ehlhardt <williamehlhardt@gmail.com>
date Thu, 12 Jul 2007 01:10:04 +0000
parents 0d4b84820390
children bc4d0ebeabd3
comparison
equal deleted inserted replaced
19011:b4207894b534 19012:b1090cbfc286
201 g_return_val_if_fail(scheme->check_subject_name, FALSE); 201 g_return_val_if_fail(scheme->check_subject_name, FALSE);
202 202
203 return (scheme->check_subject_name)(crt, name); 203 return (scheme->check_subject_name)(crt, name);
204 } 204 }
205 205
206 gboolean
207 purple_certificate_get_times(PurpleCertificate *crt, time_t *activation, time_t *expiration)
208 {
209 PurpleCertificateScheme *scheme;
210
211 g_return_val_if_fail(crt, FALSE);
212
213 scheme = crt->scheme;
214
215 g_return_val_if_fail(scheme, FALSE);
216
217 /* If both provided references are NULL, what are you doing calling
218 this? */
219 g_return_val_if_fail( (activation != NULL) || (expiration != NULL), FALSE);
220
221 /* Fulfill the caller's requests, if possible */
222 if (activation) {
223 g_return_val_if_fail(scheme->get_activation, FALSE);
224 *activation = scheme->get_activation(crt);
225 }
226 if (expiration) {
227 g_return_val_if_fail(scheme->get_expiration, FALSE);
228 *expiration = scheme->get_expiration(crt);
229 }
230
231 return TRUE;
232 }
233
206 234
207 gchar * 235 gchar *
208 purple_certificate_pool_mkpath(PurpleCertificatePool *pool, const gchar *id) 236 purple_certificate_pool_mkpath(PurpleCertificatePool *pool, const gchar *id)
209 { 237 {
210 gchar *path; 238 gchar *path;