1 /* crlfetch.h - LDAP access
2 * Copyright (C) 2002 Klarälvdalens Datakonsult AB
4 * This file is part of DirMngr.
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.
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.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, see <https://www.gnu.org/licenses/>.
26 struct cert_fetch_context_s;
27 typedef struct cert_fetch_context_s *cert_fetch_context_t;
30 /* Fetch CRL from URL. */
31 gpg_error_t crl_fetch (ctrl_t ctrl, const char* url, ksba_reader_t *reader);
33 /* Fetch CRL for ISSUER using default server. */
34 gpg_error_t crl_fetch_default (ctrl_t ctrl,
35 const char* issuer, ksba_reader_t *reader);
38 /* Fetch cert for DN. */
39 gpg_error_t ca_cert_fetch (ctrl_t ctrl, cert_fetch_context_t *context,
43 /* Query the server for certs matching patterns. */
44 gpg_error_t start_cert_fetch (ctrl_t ctrl,
45 cert_fetch_context_t *context,
47 const ldap_server_t server);
48 gpg_error_t fetch_next_cert(cert_fetch_context_t context,
49 unsigned char **value, size_t *valuelen);
50 gpg_error_t fetch_next_ksba_cert (cert_fetch_context_t context,
52 void end_cert_fetch (cert_fetch_context_t context);
54 /* Lookup a cert by it's URL. */
55 gpg_error_t fetch_cert_by_url (ctrl_t ctrl, const char *url,
56 unsigned char **value, size_t *valuelen);
58 /* Close a reader object. */
59 void crl_close_reader (ksba_reader_t reader);
64 gpg_error_t url_fetch_ldap (ctrl_t ctrl,
65 const char *url, const char *host, int port,
66 ksba_reader_t *reader);
67 gpg_error_t attr_fetch_ldap (ctrl_t ctrl,
68 const char *dn, const char *attr,
69 ksba_reader_t *reader);
72 gpg_error_t start_default_fetch_ldap (ctrl_t ctrl,
73 cert_fetch_context_t *context,
74 const char *dn, const char *attr);
75 gpg_error_t start_cert_fetch_ldap( ctrl_t ctrl,
76 cert_fetch_context_t *context,
78 const ldap_server_t server );
79 gpg_error_t fetch_next_cert_ldap (cert_fetch_context_t context,
80 unsigned char **value, size_t *valuelen );
81 void end_cert_fetch_ldap (cert_fetch_context_t context);
88 #endif /* CRLFETCH_H */