pkcs11-helper
pkcs11h-openssl.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2005-2011 Alon Bar-Lev <alon.barlev@gmail.com>
3 * All rights reserved.
4 *
5 * This software is available to you under a choice of one of two
6 * licenses. You may choose to be licensed under the terms of the GNU
7 * General Public License (GPL) Version 2, or the BSD license.
8 *
9 * GNU General Public License (GPL) Version 2
10 * ===========================================
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2
13 * as published by the Free Software Foundation.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program (see the file COPYING.GPL included with this
22 * distribution); if not, write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 *
25 * BSD License
26 * ============
27 * Redistribution and use in source and binary forms, with or without
28 * modification, are permitted provided that the following conditions are met:
29 *
30 * o Redistributions of source code must retain the above copyright notice,
31 * this list of conditions and the following disclaimer.
32 * o Redistributions in binary form must reproduce the above copyright
33 * notice, this list of conditions and the following disclaimer in the
34 * documentation and/or other materials provided with the distribution.
35 * o Neither the name of the Alon Bar-Lev nor the names of its
36 * contributors may be used to endorse or promote products derived from
37 * this software without specific prior written permission.
38 *
39 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
40 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
42 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
43 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
44 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
45 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
46 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
47 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
49 * POSSIBILITY OF SUCH DAMAGE.
50 */
51
67#ifndef __PKCS11H_HELPER_H
68#define __PKCS11H_HELPER_H
69
70#include <openssl/x509.h>
73
74#if defined(__cplusplus)
75extern "C" {
76#endif
77
83 IN const pkcs11h_certificate_t certificate
84);
85
86struct pkcs11h_openssl_session_s;
87
91typedef struct pkcs11h_openssl_session_s *pkcs11h_openssl_session_t;
92
98X509 *
100 IN const pkcs11h_certificate_t certificate
101);
102
112 IN const pkcs11h_certificate_t certificate
113);
114
122 IN const pkcs11h_openssl_session_t openssl_session
123);
124
130void
132 IN const pkcs11h_openssl_session_t openssl_session,
133 IN const pkcs11h_hook_openssl_cleanup_t cleanup
134);
135
141void
143 IN const pkcs11h_openssl_session_t openssl_session
144);
145
151RSA *
153 IN const pkcs11h_openssl_session_t openssl_session
154);
155
161EVP_PKEY *
163 IN const pkcs11h_openssl_session_t openssl_session
164);
165
171X509 *
173 IN const pkcs11h_openssl_session_t openssl_session
174);
175
176#ifdef __cplusplus
177}
178#endif
179
182#endif /* __PKCS11H_OPENSSL_H */
struct pkcs11h_certificate_s * pkcs11h_certificate_t
Certificate object.
Definition: pkcs11h-certificate.h:93
void pkcs11h_openssl_setCleanupHook(IN const pkcs11h_openssl_session_t openssl_session, IN const pkcs11h_hook_openssl_cleanup_t cleanup)
Sets cleanup hook.
RSA * pkcs11h_openssl_session_getRSA(IN const pkcs11h_openssl_session_t openssl_session)
Returns an RSA object out of the openssl_session object.
X509 * pkcs11h_openssl_session_getX509(IN const pkcs11h_openssl_session_t openssl_session)
Returns an X509 object out of the openssl_session object.
pkcs11h_hook_openssl_cleanup_t pkcs11h_openssl_getCleanupHook(IN const pkcs11h_openssl_session_t openssl_session)
Sets cleanup hook.
EVP_PKEY * pkcs11h_openssl_session_getEVP(IN const pkcs11h_openssl_session_t openssl_session)
Returns an EVP_PKEY out of the openssl_session object.
struct pkcs11h_openssl_session_s * pkcs11h_openssl_session_t
OpenSSL session reference.
Definition: pkcs11h-openssl.h:91
pkcs11h_openssl_session_t pkcs11h_openssl_createSession(IN const pkcs11h_certificate_t certificate)
Create OpenSSL session based on a certificate object.
void(* pkcs11h_hook_openssl_cleanup_t)(IN const pkcs11h_certificate_t certificate)
OpenSSL RSA cleanup hook.
Definition: pkcs11h-openssl.h:82
X509 * pkcs11h_openssl_getX509(IN const pkcs11h_certificate_t certificate)
Returns an X509 object out of the openssl_session object.
void pkcs11h_openssl_freeSession(IN const pkcs11h_openssl_session_t openssl_session)
Free OpenSSL session.
pkcs11-helper certificate functions.
pkcs11-helper core.

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