pki: Add pki --signcrl man page
[strongswan.git] / src / libtncif / tncif_identity.h
1 /*
2 * Copyright (C) 2013 Andreas Steffen
3 * HSR 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
16 /**
17 * @defgroup libtncif libtncif
18 *
19 * @addtogroup libtncif
20 * TNC interface definitions
21 *
22 * @defgroup tnc_identities tnc_identities
23 * @{ @ingroup libtncif
24 */
25
26 #ifndef TNCIF_IDENTITY_H_
27 #define TNCIF_IDENTITY_H_
28
29 #include <library.h>
30
31 #include <pen/pen.h>
32 #include <bio/bio_reader.h>
33 #include <bio/bio_writer.h>
34
35 #define TNCIF_IDENTITY_MIN_SIZE 28
36
37 typedef struct tncif_identity_t tncif_identity_t;
38
39 /**
40 * Public interface of a TNC Identity object
41 */
42 struct tncif_identity_t {
43
44 /**
45 * Get the TNC Identity Type
46 *
47 * @return TNC Identity Type
48 */
49 pen_type_t (*get_identity_type)(tncif_identity_t *this);
50
51 /**
52 * Get the TNC Identity Value
53 *
54 * @return TNC Identity Value
55 */
56 chunk_t (*get_identity_value)(tncif_identity_t *this);
57
58 /**
59 * Get the TNC Subject Type
60 *
61 * @return TNC Subject Type
62 */
63 pen_type_t (*get_subject_type)(tncif_identity_t *this);
64
65 /**
66 * Get the TNC Authentication Type
67 *
68 * @return TNC Authentication Type
69 */
70 pen_type_t (*get_auth_type)(tncif_identity_t *this);
71
72 /**
73 * Build the IF-IMV TNC Identity attribute encoding
74 *
75 * @param writer writer to write encoded data to
76 */
77 void (*build)(tncif_identity_t *this, bio_writer_t *writer);
78
79 /**
80 * Process the IF-IMV TNC Identity attribute encoding
81 *
82 * @param reader reader to read encoded data from
83 * @return TRUE if successful
84 */
85 bool (*process)(tncif_identity_t *this, bio_reader_t *reader);
86
87 /**
88 * Destroys a tncif_identity_t object.
89 */
90 void (*destroy)(tncif_identity_t *this);
91
92 };
93
94 /**
95 * Create an empty TNC Identity object
96 */
97 tncif_identity_t* tncif_identity_create_empty(void);
98
99 /**
100 * Create an TNC Identity object from its components
101 *
102 * @param identity_type TNC Identity Type
103 * @param identity_value TNC Identity Value (not cloned by constructor)
104 * @param subject_type TNC Subject Type
105 * @param auth_type TNC Authentication Type
106 */
107 tncif_identity_t* tncif_identity_create(pen_type_t identity_type,
108 chunk_t identity_value,
109 pen_type_t subject_type,
110 pen_type_t auth_type);
111
112 #endif /** TNCIF_IDENTITY_H_ @}*/