summaryrefslogtreecommitdiffstats
path: root/dirmngr/crlcache.h
blob: 37594346298064b74fa7e7656a580555d746ec30 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/* crlcache.h - LDAP access
 *      Copyright (C) 2002 Klarälvdalens Datakonsult AB
 *
 * This file is part of DirMngr.
 *
 * DirMngr is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * DirMngr is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
 */

#ifndef CRLCACHE_H
#define CRLCACHE_H


typedef enum
  {
    CRL_CACHE_VALID = 0,
    CRL_CACHE_INVALID,
    CRL_CACHE_DONTKNOW,
    CRL_CACHE_NOTTRUSTED,
    CRL_CACHE_CANTUSE
  }
crl_cache_result_t;

typedef enum foo
  {
    CRL_SIG_OK = 0,
    CRL_SIG_NOT_OK,
    CRL_TOO_OLD,
    CRL_SIG_ERROR,
    CRL_GENERAL_ERROR
  }
crl_sig_result_t;

struct crl_cache_entry_s;
typedef struct crl_cache_entry_s *crl_cache_entry_t;

/*-- crlcache.c --*/

void crl_cache_init (void);
void crl_cache_deinit (void);
int crl_cache_flush(void);

crl_cache_result_t crl_cache_isvalid (ctrl_t ctrl,
                                      const char *issuer_hash,
                                      const char *cert_id,
                                      int force_refresh);

gpg_error_t crl_cache_cert_isvalid (ctrl_t ctrl, ksba_cert_t cert,
                                    int force_refresh);

gpg_error_t crl_cache_insert (ctrl_t ctrl, const char *url,
                              ksba_reader_t reader);

gpg_error_t crl_cache_list (estream_t fp);

gpg_error_t crl_cache_load (ctrl_t ctrl, const char *filename);

gpg_error_t crl_cache_reload_crl (ctrl_t ctrl, ksba_cert_t cert);


/*-- fakecrl.c --*/
crl_cache_result_t fakecrl_isvalid (ctrl_t ctrl,
                                    const char *issuer_hash,
                                    const char *cert_id);



#endif /* CRLCACHE_H */