pkcs11-helper-1.0/pkcs11h-openssl.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2005-2007 Alon Bar-Lev <alon.barlev@gmail.com>
00003  * All rights reserved.
00004  *
00005  * This software is available to you under a choice of one of two
00006  * licenses.  You may choose to be licensed under the terms of the GNU
00007  * General Public License (GPL) Version 2, or the BSD license.
00008  *
00009  * GNU General Public License (GPL) Version 2
00010  * ===========================================
00011  * This program is free software; you can redistribute it and/or modify
00012  * it under the terms of the GNU General Public License version 2
00013  * as published by the Free Software Foundation.
00014  *
00015  * This program is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  * GNU General Public License for more details.
00019  *
00020  * You should have received a copy of the GNU General Public License
00021  * along with this program (see the file COPYING.GPL included with this
00022  * distribution); if not, write to the Free Software Foundation, Inc.,
00023  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
00024  *
00025  * BSD License
00026  * ============
00027  * Redistribution and use in source and binary forms, with or without
00028  * modification, are permitted provided that the following conditions are met:
00029  *
00030  *     o Redistributions of source code must retain the above copyright notice,
00031  *       this list of conditions and the following disclaimer.
00032  *     o Redistributions in binary form must reproduce the above copyright
00033  *       notice, this list of conditions and the following disclaimer in the
00034  *       documentation and/or other materials provided with the distribution.
00035  *     o Neither the name of the <ORGANIZATION> nor the names of its
00036  *       contributors may be used to endorse or promote products derived from
00037  *       this software without specific prior written permission.
00038  *
00039  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00040  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00041  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00042  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
00043  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
00044  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
00045  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
00046  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
00047  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
00048  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00049  * POSSIBILITY OF SUCH DAMAGE.
00050  */
00051 
00067 #ifndef __PKCS11H_HELPER_H
00068 #define __PKCS11H_HELPER_H
00069 
00070 #include <openssl/x509.h>
00071 #include <pkcs11-helper-1.0/pkcs11h-core.h>
00072 #include <pkcs11-helper-1.0/pkcs11h-certificate.h>
00073 
00074 #if defined(__cplusplus)
00075 extern "C" {
00076 #endif
00077 
00082 typedef void (*pkcs11h_hook_openssl_cleanup_t) (
00083         IN const pkcs11h_certificate_t certificate
00084 );
00085 
00086 struct pkcs11h_openssl_session_s;
00087 
00091 typedef struct pkcs11h_openssl_session_s *pkcs11h_openssl_session_t;
00092 
00098 X509 *
00099 pkcs11h_openssl_getX509 (
00100         IN const pkcs11h_certificate_t certificate
00101 );
00102 
00110 pkcs11h_openssl_session_t
00111 pkcs11h_openssl_createSession (
00112         IN const pkcs11h_certificate_t certificate
00113 );
00114 
00120 pkcs11h_hook_openssl_cleanup_t
00121 pkcs11h_openssl_getCleanupHook (
00122         IN const pkcs11h_openssl_session_t openssl_session
00123 );
00124 
00130 void
00131 pkcs11h_openssl_setCleanupHook (
00132         IN const pkcs11h_openssl_session_t openssl_session,
00133         IN const pkcs11h_hook_openssl_cleanup_t cleanup
00134 );
00135 
00141 void
00142 pkcs11h_openssl_freeSession (
00143         IN const pkcs11h_openssl_session_t openssl_session
00144 );
00145 
00151 RSA *
00152 pkcs11h_openssl_session_getRSA (
00153         IN const pkcs11h_openssl_session_t openssl_session
00154 );
00155 
00161 X509 *
00162 pkcs11h_openssl_session_getX509 (
00163         IN const pkcs11h_openssl_session_t openssl_session
00164 );
00165 
00166 #ifdef __cplusplus
00167 }
00168 #endif
00169 
00172 #endif                          /* __PKCS11H_OPENSSL_H */

pkcs11-helper, Copyright (C) Alon Bar-Lev <alon.barlev@gmail.com>OpenSC-Project.org Logo