updated x509/CRL/AC API to align with public key, authKeyIdentifier is a chunk
[strongswan.git] / src / libstrongswan / credentials / certificates / ac.h
1 /*
2 * Copyright (C) 2002 Ueli Galizzi, Ariane Seiler
3 * Copyright (C) 2003 Martin Berner, Lukas Suter
4 * Copyright (C) 2002-2008 Andreas Steffen
5 *
6 * Hochschule fuer Technik Rapperswil
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 * for more details.
17 */
18
19 /**
20 * @defgroup ac ac
21 * @{ @ingroup certificates
22 */
23
24 #ifndef AC_H_
25 #define AC_H_
26
27 #include <library.h>
28 #include <credentials/certificates/certificate.h>
29
30 typedef struct ac_t ac_t;
31
32 /**
33 * X.509 attribute certificate interface.
34 *
35 * This interface adds additional methods to the certificate_t type to
36 * allow further operations on these certificates.
37 */
38 struct ac_t {
39
40 /**
41 * Implements the certificate_t interface
42 */
43 certificate_t certificate;
44
45 /**
46 * Get the attribute certificate's serial number.
47 *
48 * @return chunk pointing to serialNumber
49 */
50 chunk_t (*get_serial)(ac_t *this);
51
52 /**
53 * Get the serial number of the holder certificate.
54 *
55 * @return chunk pointing to serialNumber
56 */
57 chunk_t (*get_holderSerial)(ac_t *this);
58
59 /**
60 * Get the issuer of the holder certificate.
61 *
62 * @return holderIssuer as identification_t*
63 */
64 identification_t* (*get_holderIssuer)(ac_t *this);
65
66 /**
67 * Get the thauthorityKeyIdentifier.
68 *
69 * @return authKeyIdentifier as chunk_t, to internal data
70 */
71 chunk_t (*get_authKeyIdentifier)(ac_t *this);
72
73 /**
74 * @brief Checks if two attribute certificates belong to the same holder
75 *
76 * @param this calling attribute certificate
77 * @param that other attribute certificate
78 * @return TRUE if same holder
79 */
80 bool (*equals_holder) (ac_t *this, ac_t *other);
81 };
82
83 #endif /** AC_H_ @}*/