pkcs11.h
ce98fd24
 /*
  *  OpenVPN -- An application to securely tunnel IP networks
  *             over a single TCP/UDP port, with support for SSL/TLS-based
  *             session authentication and key exchange,
  *             packet encryption, packet authentication, and
  *             packet compression.
  *
564a2109
  *  Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
ce98fd24
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License version 2
  *  as published by the Free Software Foundation.
  *
  *  This program is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
  *  along with this program (see the file COPYING included with this
  *  distribution); if not, write to the Free Software Foundation, Inc.,
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 #ifndef OPENVPN_PKCS11_H
 #define OPENVPN_PKCS11_H
 
be38c051
 #if defined(ENABLE_PKCS11)
 
 #include <openssl/ssl.h>
3d423bbe
 
33c8c4d4
 bool
984cf003
 pkcs11_initialize (
18597b93
 	const bool fProtectedAuthentication,
6835555e
 	const int nPINCachePeriod
 );
 
 void
984cf003
 pkcs11_terminate ();
6835555e
 
 void
984cf003
 pkcs11_forkFixup ();
6835555e
 
33c8c4d4
 bool
984cf003
 pkcs11_addProvider (
6835555e
 	const char * const provider,
18597b93
 	const bool fProtectedAuthentication,
718526e0
 	const unsigned private_mode,
18597b93
 	const bool fCertIsPrivate
6835555e
 );
 
ce98fd24
 int
718526e0
 pkcs11_logout();
 
 int
1bda73a7
 pkcs11_management_id_count ();
 
 bool
 pkcs11_management_id_get (
 	const int index,
 	char ** id,
 	char **base64
 );
 
 int
ce98fd24
 SSL_CTX_use_pkcs11 (
 	SSL_CTX * const ssl_ctx,
1bda73a7
 	bool pkcs11_id_management,
18597b93
 	const char * const pkcs11_id
ce98fd24
 );
 
 void
718526e0
 show_pkcs11_ids (
ce98fd24
 	const char * const provider,
718526e0
 	bool cert_private
ce98fd24
 );
 
6835555e
 #endif			/* ENABLE_PKCS11 */
3d423bbe
 
18597b93
 #endif			/* OPENVPN_PKCS11H_H */