b3ea725a2e577b2ce8225d7300920e1769cd2292
[strongswan.git] / src / libstrongswan / plugins / pkcs11 / pkcs11_public_key.h
1 /*
2 * Copyright (C) 2010 Martin Willi
3 * Copyright (C) 2010 revosec AG
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 pkcs11_public_key pkcs11_public_key
18 * @{ @ingroup pkcs11
19 */
20
21 #ifndef PKCS11_PUBLIC_KEY_H_
22 #define PKCS11_PUBLIC_KEY_H_
23
24 typedef struct pkcs11_public_key_t pkcs11_public_key_t;
25
26 #include <credentials/builder.h>
27 #include <credentials/keys/private_key.h>
28
29 /**
30 * PKCS#11 based public key implementation.
31 */
32 struct pkcs11_public_key_t {
33
34 /**
35 * Implements public_key_t.
36 */
37 public_key_t key;
38 };
39
40 /**
41 * Create a public key in a PKCS#11 session.
42 *
43 * @param type type of the key
44 * @param args builder_part_t argument list
45 * @return loaded key, NULL on failure
46 */
47 pkcs11_public_key_t *pkcs11_public_key_load(key_type_t type, va_list args);
48
49 #endif /** PKCS11_PUBLIC_KEY_H_ @}*/