OpenVPN
pkcs11.h
Go to the documentation of this file.
1/*
2 * OpenVPN -- An application to securely tunnel IP networks
3 * over a single TCP/UDP port, with support for SSL/TLS-based
4 * session authentication and key exchange,
5 * packet encryption, packet authentication, and
6 * packet compression.
7 *
8 * Copyright (C) 2002-2025 OpenVPN Inc <sales@openvpn.net>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2
12 * as published by the Free Software Foundation.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, see <https://www.gnu.org/licenses/>.
21 */
22
23#ifndef OPENVPN_PKCS11_H
24#define OPENVPN_PKCS11_H
25
26#if defined(ENABLE_PKCS11)
27
28#include "ssl_common.h"
29
30bool pkcs11_initialize(const bool fProtectedAuthentication, const int nPINCachePeriod);
31
32void pkcs11_terminate(void);
33
34bool pkcs11_addProvider(const char *const provider, const bool fProtectedAuthentication,
35 const unsigned private_mode, const bool fCertIsPrivate);
36
37int pkcs11_logout(void);
38
39int pkcs11_management_id_count(void);
40
41bool pkcs11_management_id_get(const int index, char **id, char **base64);
42
43int tls_ctx_use_pkcs11(struct tls_root_ctx *const ssl_ctx, bool pkcs11_id_management,
44 const char *const pkcs11_id);
45
46void show_pkcs11_ids(const char *const provider, bool cert_private);
47
48#endif /* ENABLE_PKCS11 */
49
50#endif /* OPENVPN_PKCS11H_H */
Control Channel Common Data Structures.
Structure that wraps the TLS context.
static bool pkcs11_id_management