Bump to 2.4.3
[platform/upstream/gpg2.git] / dirmngr / crlcache.h
1 /* crlcache.h - LDAP access
2  *      Copyright (C) 2002 Klarälvdalens Datakonsult AB
3  *
4  * This file is part of DirMngr.
5  *
6  * DirMngr is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * DirMngr is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
19  */
20
21 #ifndef CRLCACHE_H
22 #define CRLCACHE_H
23
24
25 typedef enum
26   {
27     CRL_CACHE_VALID = 0,
28     CRL_CACHE_INVALID,
29     CRL_CACHE_DONTKNOW,
30     CRL_CACHE_NOTTRUSTED,
31     CRL_CACHE_CANTUSE
32   }
33 crl_cache_result_t;
34
35 typedef enum foo
36   {
37     CRL_SIG_OK = 0,
38     CRL_SIG_NOT_OK,
39     CRL_TOO_OLD,
40     CRL_SIG_ERROR,
41     CRL_GENERAL_ERROR
42   }
43 crl_sig_result_t;
44
45 struct crl_cache_entry_s;
46 typedef struct crl_cache_entry_s *crl_cache_entry_t;
47
48 /*-- crlcache.c --*/
49
50 void crl_cache_init (void);
51 void crl_cache_deinit (void);
52 int crl_cache_flush(void);
53
54 crl_cache_result_t crl_cache_isvalid (ctrl_t ctrl,
55                                       const char *issuer_hash,
56                                       const char *cert_id,
57                                       int force_refresh);
58
59 gpg_error_t crl_cache_cert_isvalid (ctrl_t ctrl, ksba_cert_t cert,
60                                     int force_refresh);
61
62 gpg_error_t crl_cache_insert (ctrl_t ctrl, const char *url,
63                               ksba_reader_t reader);
64
65 gpg_error_t crl_cache_list (estream_t fp);
66
67 gpg_error_t crl_cache_load (ctrl_t ctrl, const char *filename);
68
69 gpg_error_t crl_cache_reload_crl (ctrl_t ctrl, ksba_cert_t cert);
70
71
72 /*-- fakecrl.c --*/
73 gpg_error_t fakecrl_isvalid (ctrl_t ctrl,
74                              const char *issuer_hash,
75                              const char *cert_id);
76
77
78
79 #endif /* CRLCACHE_H */