support of ca info records
[strongswan.git] / src / libstrongswan / crypto / ca.h
1 /**
2 * @file ca.h
3 *
4 * @brief Interface of ca_info_t.
5 *
6 */
7
8 /*
9 * Copyright (C) 2007 Andreas Steffen
10 * Hochschule fuer Technik Rapperswil
11 *
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>.
16 *
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
20 * for more details.
21 */
22
23 #ifndef CA_H_
24 #define CA_H_
25
26 typedef struct ca_info_t ca_info_t;
27
28 #include <library.h>
29
30 #include "x509.h"
31
32 /**
33 * @brief X.509 certification authority information record
34 *
35 * @b Constructors:
36 * - ca_info_create()
37 *
38 * @ingroup transforms
39 */
40 struct ca_info_t {
41
42 /**
43 * @brief Adds a CRL URI to a list
44 *
45 * @param this ca info object
46 * @param uri crl uri string to be added
47 */
48 void (*add_crluri) (ca_info_t *this, const char* uri);
49
50 /**
51 * @brief Adds a CRL URI to a list
52 *
53 * @param this ca info object
54 * @param uri ocsp uri string to be added
55 */
56 void (*add_ocspuri) (ca_info_t *this, const char* uri);
57
58 /**
59 * @brief Destroys a ca info record
60 *
61 * @param this ca info to destroy
62 */
63 void (*destroy) (ca_info_t *this);
64 };
65
66 /**
67 * @brief Create a ca info record
68 *
69 * @param name name of the ca info record
70 * @param cacert path to the ca certificate
71 * @return created ca_info_t, or NULL if invalid.
72 *
73 * @ingroup transforms
74 */
75 ca_info_t *ca_info_create(const char *name, const x509_t *cacert);
76
77 #endif /* CA_H_ */