]> git.ipfire.org Git - thirdparty/strongswan.git/blob - src/libcharon/encoding/payloads/certreq_payload.h
Update copyright headers after acquisition by secunet
[thirdparty/strongswan.git] / src / libcharon / encoding / payloads / certreq_payload.h
1 /*
2 * Copyright (C) 2005-2006 Martin Willi
3 * Copyright (C) 2005 Jan Hutter
4 *
5 * Copyright (C) secunet Security Networks AG
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 * for more details.
16 */
17
18 /**
19 * @defgroup certreq_payload certreq_payload
20 * @{ @ingroup payloads
21 */
22
23 #ifndef CERTREQ_PAYLOAD_H_
24 #define CERTREQ_PAYLOAD_H_
25
26 typedef struct certreq_payload_t certreq_payload_t;
27
28 #include <library.h>
29 #include <encoding/payloads/payload.h>
30 #include <encoding/payloads/cert_payload.h>
31 #include <utils/identification.h>
32
33 /**
34 * Class representing an IKEv1/IKEv2 CERTREQ payload.
35 */
36 struct certreq_payload_t {
37
38 /**
39 * The payload_t interface.
40 */
41 payload_t payload_interface;
42
43 /**
44 * Create an enumerator over contained keyids (IKEv2 only).
45 *
46 * @return enumerator over chunk_t's.
47 */
48 enumerator_t* (*create_keyid_enumerator)(certreq_payload_t *this);
49
50 /**
51 * Get the type of contained certificate keyids.
52 *
53 * @return certificate keyid type
54 */
55 certificate_type_t (*get_cert_type)(certreq_payload_t *this);
56
57 /**
58 * Add a certificates keyid to the payload (IKEv2 only).
59 *
60 * @param keyid keyid of the trusted certificate
61 * @return
62 */
63 void (*add_keyid)(certreq_payload_t *this, chunk_t keyid);
64
65 /**
66 * Get the distinguished name of the payload (IKEv1 only).
67 *
68 * @return DN as identity, must be destroyed
69 */
70 identification_t* (*get_dn)(certreq_payload_t *this);
71
72 /**
73 * Destroys an certreq_payload_t object.
74 */
75 void (*destroy) (certreq_payload_t *this);
76 };
77
78 /**
79 * Creates an empty certreq_payload_t object.
80 *
81 * @return certreq payload
82 */
83 certreq_payload_t *certreq_payload_create(payload_type_t payload_type);
84
85 /**
86 * Creates an empty IKEv2 certreq_payload_t for a kind of certificates.
87 *
88 * @param type type of the added keyids
89 * @return certreq payload
90 */
91 certreq_payload_t *certreq_payload_create_type(certificate_type_t type);
92
93 /**
94 * Creates a IKEv1 certreq_payload_t for a given distinguished name.
95 *
96 * @param id distinguished name, does not get owned
97 * @return certreq payload
98 */
99 certreq_payload_t *certreq_payload_create_dn(identification_t *id);
100
101 #endif /** CERTREQ_PAYLOAD_H_ @}*/