updated Doxyfile
[strongswan.git] / src / libstrongswan / credentials / certificates / x509.h
1 /*
2 * Copyright (C) 2007-2008 Martin Willi
3 * Hochschule fuer Technik Rapperswil
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * for more details.
14 *
15 * $Id$
16 */
17
18 /**
19 * @defgroup x509 x509
20 * @{ @ingroup certificates
21 */
22
23 #ifndef X509_H_
24 #define X509_H_
25
26 #include <utils/enumerator.h>
27 #include <credentials/certificates/certificate.h>
28
29 typedef struct x509_t x509_t;
30 typedef enum x509_flag_t x509_flag_t;
31
32 /**
33 * X.509 certificate flags.
34 */
35 enum x509_flag_t {
36 /** cert has CA constraint */
37 X509_CA = (1<<0),
38 /** cert has AA constraint */
39 X509_AA = (1<<1),
40 /** cert has OCSP signer constraint */
41 X509_OCSP_SIGNER = (1<<2),
42 /** cert is self-signed */
43 X509_SELF_SIGNED = (1<<3),
44 };
45
46 /**
47 * enum names for x509 flags
48 */
49 extern enum_name_t *x509_flag_names;
50
51 /**
52 * X.509 certificate interface.
53 *
54 * This interface adds additional methods to the certificate_t type to
55 * allow further operations on these certificates.
56 */
57 struct x509_t {
58
59 /**
60 * Implements certificate_t.
61 */
62 certificate_t interface;
63
64 /**
65 * Get the flags set for this certificate.
66 *
67 * @return set of flags
68 */
69 x509_flag_t (*get_flags)(x509_t *this);
70
71 /**
72 * Get the certificate serial number.
73 *
74 * @return chunk pointing to internal serial number
75 */
76 chunk_t (*get_serial)(x509_t *this);
77
78 /**
79 * Get the the authorityKeyIdentifier.
80 *
81 * @return authKeyIdentifier as identification_t*
82 */
83 identification_t* (*get_authKeyIdentifier)(x509_t *this);
84
85 /**
86 * Create an enumerator over all subjectAltNames.
87 *
88 * @return enumerator over subjectAltNames as identification_t*
89 */
90 enumerator_t* (*create_subjectAltName_enumerator)(x509_t *this);
91
92 /**
93 * Create an enumerator over all CRL URIs.
94 *
95 * @return enumerator over URIs as char*
96 */
97 enumerator_t* (*create_crl_uri_enumerator)(x509_t *this);
98
99 /**
100 * Create an enumerator over all OCSP URIs.
101 *
102 * @return enumerator over URIs as char*
103 */
104 enumerator_t* (*create_ocsp_uri_enumerator)(x509_t *this);
105 };
106
107 #endif /** X509_H_ @}*/