4e33390bbd85e1121f03449182202bea63e23ce1
[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 * $Id: ac.h 3300 2007-10-12 21:53:18Z andreas $
19 */
20
21 /**
22 * @defgroup ac ac
23 * @{ @ingroup certificates
24 */
25
26 #ifndef AC_H_
27 #define AC_H_
28
29 #include <library.h>
30 #include <credentials/certificates/certificate.h>
31
32 typedef struct ac_t ac_t;
33
34 /**
35 * X.509 attribute certificate interface.
36 *
37 * This interface adds additional methods to the certificate_t type to
38 * allow further operations on these certificates.
39 */
40 struct ac_t {
41
42 /**
43 * Implements the certificate_t interface
44 */
45 certificate_t certificate;
46
47 /**
48 * Get the attribute certificate's serial number.
49 *
50 * @return chunk pointing to serialNumber
51 */
52 chunk_t (*get_serial)(ac_t *this);
53
54 /**
55 * Get the serial number of the holder certificate.
56 *
57 * @return chunk pointing to serialNumber
58 */
59 chunk_t (*get_holderSerial)(ac_t *this);
60
61 /**
62 * Get the issuer of the holder certificate.
63 *
64 * @return holderIssuer as identification_t*
65 */
66 identification_t* (*get_holderIssuer)(ac_t *this);
67
68 /**
69 * Get the thauthorityKeyIdentifier.
70 *
71 * @return authKeyIdentifier as identification_t*
72 */
73 identification_t* (*get_authKeyIdentifier)(ac_t *this);
74
75 /**
76 * @brief Checks if two attribute certificates belong to the same holder
77 *
78 * @param this calling attribute certificate
79 * @param that other attribute certificate
80 * @return TRUE if same holder
81 */
82 bool (*equals_holder) (ac_t *this, ac_t *other);
83 };
84
85 #endif /* AC_H_ @}*/
86