added .gitignore files to NM applet
[strongswan.git] / src / charon / sa / authenticators / pubkey_authenticator.h
1 /*
2 * Copyright (C) 2008 Tobias Brunner
3 * Copyright (C) 2006-2009 Martin Willi
4 * Hochschule fuer Technik Rapperswil
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * for more details.
15 */
16
17 /**
18 * @defgroup pubkey_authenticator pubkey_authenticator
19 * @{ @ingroup authenticators
20 */
21
22 #ifndef PUBKEY_AUTHENTICATOR_H_
23 #define PUBKEY_AUTHENTICATOR_H_
24
25 typedef struct pubkey_authenticator_t pubkey_authenticator_t;
26
27 #include <sa/authenticators/authenticator.h>
28
29 /**
30 * Implementation of authenticator_t using public key authenitcation.
31 */
32 struct pubkey_authenticator_t {
33
34 /**
35 * Implemented authenticator_t interface.
36 */
37 authenticator_t authenticator;
38 };
39
40 /**
41 * Create an authenticator to build public key signatures.
42 *
43 * @param ike_sa associated ike_sa
44 * @param received_nonce nonce received in IKE_SA_INIT
45 * @param sent_init sent IKE_SA_INIT message data
46 * @return public key authenticator
47 */
48 pubkey_authenticator_t *pubkey_authenticator_create_builder(ike_sa_t *ike_sa,
49 chunk_t received_nonce, chunk_t sent_init);
50
51 /**
52 * Create an authenticator to verify public key signatures.
53 *
54 * @param ike_sa associated ike_sa
55 * @param sent_nonce nonce sent in IKE_SA_INIT
56 * @param received_init received IKE_SA_INIT message data
57 * @return public key authenticator
58 */
59 pubkey_authenticator_t *pubkey_authenticator_create_verifier(ike_sa_t *ike_sa,
60 chunk_t sent_nonce, chunk_t received_init);
61
62 #endif /** PUBKEY_AUTHENTICATOR_H_ @}*/