<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/> <title>pkcs11-helper: pkcs11-helper-1.0/pkcs11h-core.h Source File</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body> <!-- Generated by Doxygen 1.6.0 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> <li><a href="examples.html"><span>Examples</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="files.html"><span>File List</span></a></li> <li><a href="globals.html"><span>File Members</span></a></li> </ul> </div> <h1>pkcs11-helper-1.0/pkcs11h-core.h</h1><a href="pkcs11h-core_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> <a name="l00002"></a>00002 <span class="comment"> * Copyright (c) 2005-2008 Alon Bar-Lev <alon.barlev@gmail.com></span> <a name="l00003"></a>00003 <span class="comment"> * All rights reserved.</span> <a name="l00004"></a>00004 <span class="comment"> *</span> <a name="l00005"></a>00005 <span class="comment"> * This software is available to you under a choice of one of two</span> <a name="l00006"></a>00006 <span class="comment"> * licenses. You may choose to be licensed under the terms of the GNU</span> <a name="l00007"></a>00007 <span class="comment"> * General Public License (GPL) Version 2, or the BSD license.</span> <a name="l00008"></a>00008 <span class="comment"> *</span> <a name="l00009"></a>00009 <span class="comment"> * GNU General Public License (GPL) Version 2</span> <a name="l00010"></a>00010 <span class="comment"> * ===========================================</span> <a name="l00011"></a>00011 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span> <a name="l00012"></a>00012 <span class="comment"> * it under the terms of the GNU General Public License version 2</span> <a name="l00013"></a>00013 <span class="comment"> * as published by the Free Software Foundation.</span> <a name="l00014"></a>00014 <span class="comment"> *</span> <a name="l00015"></a>00015 <span class="comment"> * This program is distributed in the hope that it will be useful,</span> <a name="l00016"></a>00016 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span> <a name="l00017"></a>00017 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span> <a name="l00018"></a>00018 <span class="comment"> * GNU General Public License for more details.</span> <a name="l00019"></a>00019 <span class="comment"> *</span> <a name="l00020"></a>00020 <span class="comment"> * You should have received a copy of the GNU General Public License</span> <a name="l00021"></a>00021 <span class="comment"> * along with this program (see the file COPYING.GPL included with this</span> <a name="l00022"></a>00022 <span class="comment"> * distribution); if not, write to the Free Software Foundation, Inc.,</span> <a name="l00023"></a>00023 <span class="comment"> * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.</span> <a name="l00024"></a>00024 <span class="comment"> *</span> <a name="l00025"></a>00025 <span class="comment"> * BSD License</span> <a name="l00026"></a>00026 <span class="comment"> * ============</span> <a name="l00027"></a>00027 <span class="comment"> * Redistribution and use in source and binary forms, with or without</span> <a name="l00028"></a>00028 <span class="comment"> * modification, are permitted provided that the following conditions are met:</span> <a name="l00029"></a>00029 <span class="comment"> *</span> <a name="l00030"></a>00030 <span class="comment"> * o Redistributions of source code must retain the above copyright notice,</span> <a name="l00031"></a>00031 <span class="comment"> * this list of conditions and the following disclaimer.</span> <a name="l00032"></a>00032 <span class="comment"> * o Redistributions in binary form must reproduce the above copyright</span> <a name="l00033"></a>00033 <span class="comment"> * notice, this list of conditions and the following disclaimer in the</span> <a name="l00034"></a>00034 <span class="comment"> * documentation and/or other materials provided with the distribution.</span> <a name="l00035"></a>00035 <span class="comment"> * o Neither the name of the <ORGANIZATION> nor the names of its</span> <a name="l00036"></a>00036 <span class="comment"> * contributors may be used to endorse or promote products derived from</span> <a name="l00037"></a>00037 <span class="comment"> * this software without specific prior written permission.</span> <a name="l00038"></a>00038 <span class="comment"> *</span> <a name="l00039"></a>00039 <span class="comment"> * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"</span> <a name="l00040"></a>00040 <span class="comment"> * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE</span> <a name="l00041"></a>00041 <span class="comment"> * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE</span> <a name="l00042"></a>00042 <span class="comment"> * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE</span> <a name="l00043"></a>00043 <span class="comment"> * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR</span> <a name="l00044"></a>00044 <span class="comment"> * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF</span> <a name="l00045"></a>00045 <span class="comment"> * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS</span> <a name="l00046"></a>00046 <span class="comment"> * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN</span> <a name="l00047"></a>00047 <span class="comment"> * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)</span> <a name="l00048"></a>00048 <span class="comment"> * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE</span> <a name="l00049"></a>00049 <span class="comment"> * POSSIBILITY OF SUCH DAMAGE.</span> <a name="l00050"></a>00050 <span class="comment"> */</span> <a name="l00051"></a>00051 <a name="l00067"></a>00067 <span class="preprocessor">#ifndef __PKCS11H_BASE_H</span> <a name="l00068"></a>00068 <span class="preprocessor"></span><span class="preprocessor">#define __PKCS11H_BASE_H</span> <a name="l00069"></a>00069 <span class="preprocessor"></span> <a name="l00070"></a>00070 <span class="preprocessor">#include <stdarg.h></span> <a name="l00071"></a>00071 <span class="preprocessor">#include <time.h></span> <a name="l00072"></a>00072 <a name="l00073"></a>00073 <span class="preprocessor">#include <<a class="code" href="pkcs11h-version_8h.html" title="pkcs11-helper core.">pkcs11-helper-1.0/pkcs11h-version.h</a>></span> <a name="l00074"></a>00074 <span class="preprocessor">#include <<a class="code" href="pkcs11h-def_8h.html" title="pkcs11-helper core definitions.">pkcs11-helper-1.0/pkcs11h-def.h</a>></span> <a name="l00075"></a>00075 <span class="preprocessor">#include <<a class="code" href="pkcs11h-engines_8h.html" title="pkcs11-helper engines definitions.">pkcs11-helper-1.0/pkcs11h-engines.h</a>></span> <a name="l00076"></a>00076 <a name="l00077"></a>00077 <span class="preprocessor">#if defined(__cplusplus)</span> <a name="l00078"></a>00078 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">"C"</span> { <a name="l00079"></a>00079 <span class="preprocessor">#endif</span> <a name="l00080"></a>00080 <span class="preprocessor"></span> <a name="l00088"></a><a class="code" href="group__PKCS11H__FEATURE__MASK.html#gae98df6f724480490a470e5d9a656bd00">00088</a> <span class="preprocessor">#define PKCS11H_FEATURE_MASK_ENGINE_CRYPTO_OPENSSL (1<< 0)</span> <a name="l00089"></a>00089 <span class="preprocessor"></span> <a name="l00090"></a><a class="code" href="group__PKCS11H__FEATURE__MASK.html#ga6f506cde0b150dfc1355a7dc8006918f">00090</a> <span class="preprocessor">#define PKCS11H_FEATURE_MASK_ENGINE_CRYPTO_GNUTLS (1<< 1)</span> <a name="l00091"></a>00091 <span class="preprocessor"></span> <a name="l00092"></a><a class="code" href="group__PKCS11H__FEATURE__MASK.html#ga0d93333791132e947f5d83d50a306da6">00092</a> <span class="preprocessor">#define PKCS11H_FEATURE_MASK_ENGINE_CRYPTO_WIN32 (1<< 2)</span> <a name="l00093"></a>00093 <span class="preprocessor"></span> <a name="l00094"></a><a class="code" href="group__PKCS11H__FEATURE__MASK.html#ga9ab03c77d01ebeef49faee07a7c5fb1d">00094</a> <span class="preprocessor">#define PKCS11H_FEATURE_MASK_DEBUG (1<< 3)</span> <a name="l00095"></a>00095 <span class="preprocessor"></span> <a name="l00096"></a><a class="code" href="group__PKCS11H__FEATURE__MASK.html#gaa934bab7add831fa7745ca8119206c1e">00096</a> <span class="preprocessor">#define PKCS11H_FEATURE_MASK_THREADING (1<< 4)</span> <a name="l00097"></a>00097 <span class="preprocessor"></span> <a name="l00098"></a><a class="code" href="group__PKCS11H__FEATURE__MASK.html#ga7f6cfa69a8f14730dbe518d908a38a59">00098</a> <span class="preprocessor">#define PKCS11H_FEATURE_MASK_TOKEN (1<< 5)</span> <a name="l00099"></a>00099 <span class="preprocessor"></span> <a name="l00100"></a><a class="code" href="group__PKCS11H__FEATURE__MASK.html#ga5b4e79a394675bc6d1e8759cc09b89cf">00100</a> <span class="preprocessor">#define PKCS11H_FEATURE_MASK_DATA (1<< 6)</span> <a name="l00101"></a>00101 <span class="preprocessor"></span> <a name="l00102"></a><a class="code" href="group__PKCS11H__FEATURE__MASK.html#ga31c68f7fa0e7243f519620446a98ae40">00102</a> <span class="preprocessor">#define PKCS11H_FEATURE_MASK_CERTIFICATE (1<< 7)</span> <a name="l00103"></a>00103 <span class="preprocessor"></span> <a name="l00104"></a><a class="code" href="group__PKCS11H__FEATURE__MASK.html#ga96459e8a12e272523fa14b8b9c501036">00104</a> <span class="preprocessor">#define PKCS11H_FEATURE_MASK_SLOTEVENT (1<< 8)</span> <a name="l00105"></a>00105 <span class="preprocessor"></span> <a name="l00106"></a><a class="code" href="group__PKCS11H__FEATURE__MASK.html#gad1e63fcefd732229695670530c87c3fd">00106</a> <span class="preprocessor">#define PKCS11H_FEATURE_MASK_OPENSSL (1<< 9)</span> <a name="l00107"></a>00107 <span class="preprocessor"></span> <a name="l00117"></a><a class="code" href="group__PKCS11H__LOG.html#gab6c957c9d67eb2629fb393723c829117">00117</a> <span class="preprocessor">#define PKCS11H_LOG_DEBUG2 5</span> <a name="l00118"></a>00118 <span class="preprocessor"></span> <a name="l00119"></a><a class="code" href="group__PKCS11H__LOG.html#ga00efef4b93a42915be1b7c15ab3a818e">00119</a> <span class="preprocessor">#define PKCS11H_LOG_DEBUG1 4</span> <a name="l00120"></a>00120 <span class="preprocessor"></span> <a name="l00121"></a><a class="code" href="group__PKCS11H__LOG.html#ga048242c922f4fe1097c71c34a79ff38a">00121</a> <span class="preprocessor">#define PKCS11H_LOG_INFO 3</span> <a name="l00122"></a>00122 <span class="preprocessor"></span> <a name="l00123"></a><a class="code" href="group__PKCS11H__LOG.html#ga20539146d550c940dba3134934b08720">00123</a> <span class="preprocessor">#define PKCS11H_LOG_WARN 2</span> <a name="l00124"></a>00124 <span class="preprocessor"></span> <a name="l00125"></a><a class="code" href="group__PKCS11H__LOG.html#ga23fd2c0f0f9ac8e29ffcfed3a68d3c4c">00125</a> <span class="preprocessor">#define PKCS11H_LOG_ERROR 1</span> <a name="l00126"></a>00126 <span class="preprocessor"></span> <a name="l00127"></a><a class="code" href="group__PKCS11H__LOG.html#gac9ca2ca8a6c5acdafad8ce61e99a3b7f">00127</a> <span class="preprocessor">#define PKCS11H_LOG_QUIET 0</span> <a name="l00128"></a>00128 <span class="preprocessor"></span> <a name="l00131"></a><a class="code" href="group__pkcs11h__core.html#gaf2e69452539380c208ba5cdf3977ab4d">00131</a> <span class="preprocessor">#define PKCS11H_PIN_CACHE_INFINITE -1</span> <a name="l00132"></a>00132 <span class="preprocessor"></span> <a name="l00139"></a><a class="code" href="group__PKCS11H__PRIVATEMODE__MASK.html#gafae49935ec998dabe7fd40b2ce7180dd">00139</a> <span class="preprocessor">#define PKCS11H_PRIVATEMODE_MASK_AUTO (0)</span> <a name="l00140"></a>00140 <span class="preprocessor"></span> <a name="l00141"></a><a class="code" href="group__PKCS11H__PRIVATEMODE__MASK.html#ga6e8b28ecedc482923349f0e879c7df03">00141</a> <span class="preprocessor">#define PKCS11H_PRIVATEMODE_MASK_SIGN (1<<0)</span> <a name="l00142"></a>00142 <span class="preprocessor"></span> <a name="l00143"></a><a class="code" href="group__PKCS11H__PRIVATEMODE__MASK.html#ga47af95299968ed5be7f9ee519a720743">00143</a> <span class="preprocessor">#define PKCS11H_PRIVATEMODE_MASK_RECOVER (1<<1)</span> <a name="l00144"></a>00144 <span class="preprocessor"></span> <a name="l00145"></a><a class="code" href="group__PKCS11H__PRIVATEMODE__MASK.html#gaf98e9964d6045484172d2d5b1e343b79">00145</a> <span class="preprocessor">#define PKCS11H_PRIVATEMODE_MASK_DECRYPT (1<<2)</span> <a name="l00146"></a>00146 <span class="preprocessor"></span> <a name="l00147"></a><a class="code" href="group__PKCS11H__PRIVATEMODE__MASK.html#ga065ec899c1324d5abfcfa85f077b6815">00147</a> <span class="preprocessor">#define PKCS11H_PRIVATEMODE_MASK_UNWRAP (1<<3)</span> <a name="l00148"></a>00148 <span class="preprocessor"></span> <a name="l00155"></a>00155 <span class="comment">/* Auto select by provider information. */</span> <a name="l00156"></a>00156 <span class="preprocessor">#define PKCS11H_SLOTEVENT_METHOD_AUTO 0</span> <a name="l00157"></a>00157 <span class="preprocessor"></span> <a name="l00158"></a><a class="code" href="group__PKCS11H__SLOTEVENT__METHOD.html#ga27ee34b8c6ccd7e1b30009d77b1aa11d">00158</a> <span class="preprocessor">#define PKCS11H_SLOTEVENT_METHOD_TRIGGER 1</span> <a name="l00159"></a>00159 <span class="preprocessor"></span> <a name="l00160"></a><a class="code" href="group__PKCS11H__SLOTEVENT__METHOD.html#gacef61f334831148666f8b72256280a3a">00160</a> <span class="preprocessor">#define PKCS11H_SLOTEVENT_METHOD_POLL 2</span> <a name="l00161"></a>00161 <span class="preprocessor"></span> <a name="l00162"></a><a class="code" href="group__PKCS11H__SLOTEVENT__METHOD.html#gab794d053bcef9de3e7bbcc7626aee030">00162</a> <span class="preprocessor">#define PKCS11H_SLOTEVENT_METHOD_FETCH 3</span> <a name="l00163"></a>00163 <span class="preprocessor"></span> <a name="l00171"></a><a class="code" href="group__PKCS11H__PROMPT__MASK.html#ga7be94b666dc51dd5a6e44521bfa30679">00171</a> <span class="preprocessor">#define PKCS11H_PROMPT_MASK_ALLOW_PIN_PROMPT (1<<0)</span> <a name="l00172"></a>00172 <span class="preprocessor"></span> <a name="l00173"></a><a class="code" href="group__PKCS11H__PROMPT__MASK.html#ga3fe7d4fbfe09fa857ec01050435791ed">00173</a> <span class="preprocessor">#define PKCS11H_PROMPT_MASK_ALLOW_TOKEN_PROMPT (1<<1)</span> <a name="l00174"></a>00174 <span class="preprocessor"></span> <a name="l00175"></a><a class="code" href="group__PKCS11H__PROMPT__MASK.html#ga8d14e9d7962fb1595aff5a445347f999">00175</a> <span class="preprocessor">#define PKCS11H_PROMPT_MASK_ALLOW_ALL ( \</span> <a name="l00176"></a>00176 <span class="preprocessor"> PKCS11H_PROMPT_MASK_ALLOW_PIN_PROMPT | \</span> <a name="l00177"></a>00177 <span class="preprocessor"> PKCS11H_PROMPT_MASK_ALLOW_TOKEN_PROMPT \</span> <a name="l00178"></a>00178 <span class="preprocessor"> )</span> <a name="l00179"></a>00179 <span class="preprocessor"></span> <a name="l00187"></a><a class="code" href="group__PKCS11H__ENUM__METHOD.html#gad5f4180fd158a4c377004be72041a7bc">00187</a> <span class="preprocessor">#define PKCS11H_ENUM_METHOD_CACHE 0</span> <a name="l00188"></a>00188 <span class="preprocessor"></span> <a name="l00189"></a><a class="code" href="group__PKCS11H__ENUM__METHOD.html#ga77b6a8174a2a0d051164fac7b360990b">00189</a> <span class="preprocessor">#define PKCS11H_ENUM_METHOD_CACHE_EXIST 1</span> <a name="l00190"></a>00190 <span class="preprocessor"></span> <a name="l00191"></a><a class="code" href="group__PKCS11H__ENUM__METHOD.html#ga7538f9608c7312ceb78ad9050c272740">00191</a> <span class="preprocessor">#define PKCS11H_ENUM_METHOD_RELOAD 2</span> <a name="l00192"></a>00192 <span class="preprocessor"></span> <a name="l00194"></a>00194 <span class="keyword">struct </span><a class="code" href="structpkcs11h__token__id__s.html" title="Token identifier.">pkcs11h_token_id_s</a>; <a name="l00195"></a>00195 <a name="l00199"></a><a class="code" href="group__pkcs11h__core.html#ga2b27ddc9dcad511bbe4b79d8cc83d2fd">00199</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structpkcs11h__token__id__s.html" title="Token identifier.">pkcs11h_token_id_s</a> *<a class="code" href="structpkcs11h__token__id__s.html" title="Token identifier.">pkcs11h_token_id_t</a>; <a name="l00200"></a>00200 <a name="l00208"></a><a class="code" href="group__pkcs11h__core.html#ga8c937304fe72d67d87736e0025164fa3">00208</a> <span class="keyword">typedef</span> void (*<a class="code" href="group__pkcs11h__core.html#ga8c937304fe72d67d87736e0025164fa3" title="Log hook.">pkcs11h_hook_log_t</a>)( <a name="l00209"></a>00209 IN <span class="keywordtype">void</span> * <span class="keyword">const</span> global_data, <a name="l00210"></a>00210 IN <span class="keyword">const</span> <span class="keywordtype">unsigned</span> flags, <a name="l00211"></a>00211 IN <span class="keyword">const</span> <span class="keywordtype">char</span> * <span class="keyword">const</span> format, <a name="l00212"></a>00212 IN va_list args <a name="l00213"></a>00213 ); <a name="l00214"></a>00214 <a name="l00219"></a><a class="code" href="group__pkcs11h__core.html#ga6029c2934ff6c06847e6c82060c2f3e8">00219</a> <span class="keyword">typedef</span> void (*<a class="code" href="group__pkcs11h__core.html#ga6029c2934ff6c06847e6c82060c2f3e8" title="Slotevent hook.">pkcs11h_hook_slotevent_t</a>)( <a name="l00220"></a>00220 IN <span class="keywordtype">void</span> * <span class="keyword">const</span> global_data <a name="l00221"></a>00221 ); <a name="l00222"></a>00222 <a name="l00231"></a><a class="code" href="group__pkcs11h__core.html#gaa45856a77a1f7afa6ad2486b7f4bbf59">00231</a> <span class="keyword">typedef</span> PKCS11H_BOOL (*<a class="code" href="group__pkcs11h__core.html#gaa45856a77a1f7afa6ad2486b7f4bbf59" title="Token prompt hook.">pkcs11h_hook_token_prompt_t</a>)( <a name="l00232"></a>00232 IN <span class="keywordtype">void</span> * <span class="keyword">const</span> global_data, <a name="l00233"></a>00233 IN <span class="keywordtype">void</span> * <span class="keyword">const</span> user_data, <a name="l00234"></a>00234 IN <span class="keyword">const</span> pkcs11h_token_id_t token, <a name="l00235"></a>00235 IN <span class="keyword">const</span> <span class="keywordtype">unsigned</span> retry <a name="l00236"></a>00236 ); <a name="l00237"></a>00237 <a name="l00248"></a><a class="code" href="group__pkcs11h__core.html#gabc1196aa612d052c45730fa00d519d2a">00248</a> <span class="keyword">typedef</span> PKCS11H_BOOL (*<a class="code" href="group__pkcs11h__core.html#gabc1196aa612d052c45730fa00d519d2a" title="PIN prompt hook.">pkcs11h_hook_pin_prompt_t</a>)( <a name="l00249"></a>00249 IN <span class="keywordtype">void</span> * <span class="keyword">const</span> global_data, <a name="l00250"></a>00250 IN <span class="keywordtype">void</span> * <span class="keyword">const</span> user_data, <a name="l00251"></a>00251 IN <span class="keyword">const</span> pkcs11h_token_id_t token, <a name="l00252"></a>00252 IN <span class="keyword">const</span> <span class="keywordtype">unsigned</span> retry, <a name="l00253"></a>00253 OUT <span class="keywordtype">char</span> * <span class="keyword">const</span> pin, <a name="l00254"></a>00254 IN <span class="keyword">const</span> <span class="keywordtype">size_t</span> pin_max <a name="l00255"></a>00255 ); <a name="l00256"></a>00256 <a name="l00260"></a><a class="code" href="structpkcs11h__token__id__s.html">00260</a> <span class="keyword">struct </span><a class="code" href="structpkcs11h__token__id__s.html" title="Token identifier.">pkcs11h_token_id_s</a> { <a name="l00262"></a><a class="code" href="structpkcs11h__token__id__s.html#ad6db52f96cf37880b45117537c8a17a9">00262</a> <span class="keywordtype">char</span> <a class="code" href="structpkcs11h__token__id__s.html#ad6db52f96cf37880b45117537c8a17a9">display</a>[1024]; <a name="l00264"></a><a class="code" href="structpkcs11h__token__id__s.html#a00aea9b714b2433aad3542c7cecde73e">00264</a> <span class="keywordtype">char</span> <a class="code" href="structpkcs11h__token__id__s.html#a00aea9b714b2433aad3542c7cecde73e">manufacturerID</a>[<span class="keyword">sizeof</span> (((CK_TOKEN_INFO *)NULL)->manufacturerID)+1]; <a name="l00266"></a><a class="code" href="structpkcs11h__token__id__s.html#a141fe1d2930c954dbbb847d327848582">00266</a> <span class="keywordtype">char</span> <a class="code" href="structpkcs11h__token__id__s.html#a141fe1d2930c954dbbb847d327848582">model</a>[<span class="keyword">sizeof</span> (((CK_TOKEN_INFO *)NULL)->model)+1]; <a name="l00268"></a><a class="code" href="structpkcs11h__token__id__s.html#a959ad30346aa89e6162acaf8fad900e6">00268</a> <span class="keywordtype">char</span> <a class="code" href="structpkcs11h__token__id__s.html#a959ad30346aa89e6162acaf8fad900e6">serialNumber</a>[<span class="keyword">sizeof</span> (((CK_TOKEN_INFO *)NULL)->serialNumber)+1]; <a name="l00270"></a><a class="code" href="structpkcs11h__token__id__s.html#a56c8e5ae30c8e0d94961d88092e3110f">00270</a> <span class="keywordtype">char</span> <a class="code" href="structpkcs11h__token__id__s.html#a56c8e5ae30c8e0d94961d88092e3110f">label</a>[<span class="keyword">sizeof</span> (((CK_TOKEN_INFO *)NULL)->label)+1]; <a name="l00271"></a>00271 }; <a name="l00272"></a>00272 <a name="l00278"></a>00278 <span class="keyword">const</span> <span class="keywordtype">char</span> * <a name="l00279"></a>00279 <a class="code" href="group__pkcs11h__core.html#ga9aebf44a24ec0312cbf42a1024bbf290" title="Get message by return value.">pkcs11h_getMessage</a> ( <a name="l00280"></a>00280 IN <span class="keyword">const</span> CK_RV rv <a name="l00281"></a>00281 ); <a name="l00282"></a>00282 <a name="l00287"></a>00287 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a name="l00288"></a>00288 <a class="code" href="group__pkcs11h__core.html#gaecea4287b494c1907b8c7e9dcde0d48b" title="Get version of library.">pkcs11h_getVersion</a> (<span class="keywordtype">void</span>); <a name="l00289"></a>00289 <a name="l00294"></a>00294 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a name="l00295"></a>00295 <a class="code" href="group__pkcs11h__core.html#ga66cddd754ca08b5cf82881d22853d8bf" title="Get features of library.">pkcs11h_getFeatures</a> (<span class="keywordtype">void</span>); <a name="l00296"></a>00296 <a name="l00303"></a>00303 CK_RV <a name="l00304"></a>00304 <a class="code" href="group__pkcs11h__core.html#gadf09a7c486742188b8ceedf84a5c5db6" title="Inititalize helper interface.">pkcs11h_initialize</a> (<span class="keywordtype">void</span>); <a name="l00305"></a>00305 <a name="l00311"></a>00311 CK_RV <a name="l00312"></a>00312 <a class="code" href="group__pkcs11h__core.html#gac8464931fa412eb69a118fe12c1778fe" title="Terminate helper interface.">pkcs11h_terminate</a> (<span class="keywordtype">void</span>); <a name="l00313"></a>00313 <a name="l00318"></a>00318 <span class="keywordtype">void</span> <a name="l00319"></a>00319 <a class="code" href="group__pkcs11h__core.html#gad4b64d348be65a44012d7f2160cf27b2" title="Set current log level of the helper.">pkcs11h_setLogLevel</a> ( <a name="l00320"></a>00320 IN <span class="keyword">const</span> <span class="keywordtype">unsigned</span> flags <a name="l00321"></a>00321 ); <a name="l00322"></a>00322 <a name="l00327"></a>00327 <span class="keywordtype">unsigned</span> <a name="l00328"></a>00328 <a class="code" href="group__pkcs11h__core.html#gad0c7e2b6df043b04842aeeea3904e61e" title="Get current log level.">pkcs11h_getLogLevel</a> (<span class="keywordtype">void</span>); <a name="l00329"></a>00329 <a name="l00342"></a>00342 CK_RV <a name="l00343"></a>00343 <a class="code" href="group__pkcs11h__core.html#ga1d00e131d0d583702b9f3a80da9126f8" title="How does the foked process bahaves after POSIX fork().">pkcs11h_setForkMode</a> ( <a name="l00344"></a>00344 IN <span class="keyword">const</span> PKCS11H_BOOL safe <a name="l00345"></a>00345 ); <a name="l00346"></a>00346 <a name="l00353"></a>00353 CK_RV <a name="l00354"></a>00354 <a class="code" href="group__pkcs11h__core.html#gaf5dcc671471e326942f5ad9615840e8b" title="Set a log callback.">pkcs11h_setLogHook</a> ( <a name="l00355"></a>00355 IN <span class="keyword">const</span> <a class="code" href="group__pkcs11h__core.html#ga8c937304fe72d67d87736e0025164fa3" title="Log hook.">pkcs11h_hook_log_t</a> hook, <a name="l00356"></a>00356 IN <span class="keywordtype">void</span> * <span class="keyword">const</span> global_data <a name="l00357"></a>00357 ); <a name="l00358"></a>00358 <a name="l00370"></a>00370 CK_RV <a name="l00371"></a>00371 <a class="code" href="group__pkcs11h__core.html#ga63c8c01ba69a9e831437f1ff4da58ccc" title="Set a slot event callback.">pkcs11h_setSlotEventHook</a> ( <a name="l00372"></a>00372 IN <span class="keyword">const</span> <a class="code" href="group__pkcs11h__core.html#ga6029c2934ff6c06847e6c82060c2f3e8" title="Slotevent hook.">pkcs11h_hook_slotevent_t</a> hook, <a name="l00373"></a>00373 IN <span class="keywordtype">void</span> * <span class="keyword">const</span> global_data <a name="l00374"></a>00374 ); <a name="l00375"></a>00375 <a name="l00384"></a>00384 CK_RV <a name="l00385"></a>00385 <a class="code" href="group__pkcs11h__core.html#ga27d9588bcea712bef33a03b51851ec27" title="Set a token prompt callback.">pkcs11h_setTokenPromptHook</a> ( <a name="l00386"></a>00386 IN <span class="keyword">const</span> <a class="code" href="group__pkcs11h__core.html#gaa45856a77a1f7afa6ad2486b7f4bbf59" title="Token prompt hook.">pkcs11h_hook_token_prompt_t</a> hook, <a name="l00387"></a>00387 IN <span class="keywordtype">void</span> * <span class="keyword">const</span> global_data <a name="l00388"></a>00388 ); <a name="l00389"></a>00389 <a name="l00398"></a>00398 CK_RV <a name="l00399"></a>00399 <a class="code" href="group__pkcs11h__core.html#gad5098da620784c242596dcb69e122b5b" title="Set a pin prompt callback.">pkcs11h_setPINPromptHook</a> ( <a name="l00400"></a>00400 IN <span class="keyword">const</span> <a class="code" href="group__pkcs11h__core.html#gabc1196aa612d052c45730fa00d519d2a" title="PIN prompt hook.">pkcs11h_hook_pin_prompt_t</a> hook, <a name="l00401"></a>00401 IN <span class="keywordtype">void</span> * <span class="keyword">const</span> global_data <a name="l00402"></a>00402 ); <a name="l00403"></a>00403 <a name="l00410"></a>00410 CK_RV <a name="l00411"></a>00411 <a class="code" href="group__pkcs11h__core.html#ga0f3096d8b9c573182023fc872876f22f" title="Set global protected authentication mode.">pkcs11h_setProtectedAuthentication</a> ( <a name="l00412"></a>00412 IN <span class="keyword">const</span> PKCS11H_BOOL allow_protected_auth <a name="l00413"></a>00413 ); <a name="l00414"></a>00414 <a name="l00421"></a>00421 CK_RV <a name="l00422"></a>00422 <a class="code" href="group__pkcs11h__core.html#gac96214b440aa5dd1d23be32cd9eb5562" title="Set global PIN cache timeout.">pkcs11h_setPINCachePeriod</a> ( <a name="l00423"></a>00423 IN <span class="keyword">const</span> <span class="keywordtype">int</span> pin_cache_period <a name="l00424"></a>00424 ); <a name="l00425"></a>00425 <a name="l00432"></a>00432 CK_RV <a name="l00433"></a>00433 <a class="code" href="group__pkcs11h__core.html#gad8d9f02106600463a3566775b55705a4" title="Set global login retries attempts.">pkcs11h_setMaxLoginRetries</a> ( <a name="l00434"></a>00434 IN <span class="keyword">const</span> <span class="keywordtype">unsigned</span> max_retries <a name="l00435"></a>00435 ); <a name="l00436"></a>00436 <a name="l00450"></a>00450 CK_RV <a name="l00451"></a>00451 <a class="code" href="group__pkcs11h__core.html#gafa48a26cc3c2662a87eef3eaa9523e23" title="Add a PKCS#11 provider.">pkcs11h_addProvider</a> ( <a name="l00452"></a>00452 IN <span class="keyword">const</span> <span class="keywordtype">char</span> * <span class="keyword">const</span> reference, <a name="l00453"></a>00453 IN <span class="keyword">const</span> <span class="keywordtype">char</span> * <span class="keyword">const</span> provider_location, <a name="l00454"></a>00454 IN <span class="keyword">const</span> PKCS11H_BOOL allow_protected_auth, <a name="l00455"></a>00455 IN <span class="keyword">const</span> <span class="keywordtype">unsigned</span> mask_private_mode, <a name="l00456"></a>00456 IN <span class="keyword">const</span> <span class="keywordtype">unsigned</span> slot_event_method, <a name="l00457"></a>00457 IN <span class="keyword">const</span> <span class="keywordtype">unsigned</span> slot_poll_interval, <a name="l00458"></a>00458 IN <span class="keyword">const</span> PKCS11H_BOOL cert_is_private <a name="l00459"></a>00459 ); <a name="l00460"></a>00460 <a name="l00467"></a>00467 CK_RV <a name="l00468"></a>00468 <a class="code" href="group__pkcs11h__core.html#gadb1735c34f12dd63fccf96d1bf4a2f43" title="Delete a PKCS#11 provider.">pkcs11h_removeProvider</a> ( <a name="l00469"></a>00469 IN <span class="keyword">const</span> <span class="keywordtype">char</span> * <span class="keyword">const</span> reference <a name="l00470"></a>00470 ); <a name="l00471"></a>00471 <a name="l00483"></a>00483 CK_RV <a name="l00484"></a>00484 <a class="code" href="group__pkcs11h__core.html#ga7a2efdb35cef1653f362dcbafea8683c" title="Handle special case of POSIX fork().">pkcs11h_forkFixup</a> (<span class="keywordtype">void</span>); <a name="l00485"></a>00485 <a name="l00497"></a>00497 CK_RV <a name="l00498"></a>00498 <a class="code" href="group__pkcs11h__core.html#gaf760f60ccd964c42e5a7f98e0a8e83f6" title="Handle slot rescan.">pkcs11h_plugAndPlay</a> (<span class="keywordtype">void</span>); <a name="l00499"></a>00499 <a name="l00504"></a>00504 CK_RV <a name="l00505"></a>00505 <a class="code" href="group__pkcs11h__core.html#ga3cf342b7023c90c613f1c09987fe04cd" title="Logout from all sessions.">pkcs11h_logout</a> (<span class="keywordtype">void</span>); <a name="l00506"></a>00506 <a name="l00507"></a>00507 <span class="preprocessor">#ifdef __cplusplus</span> <a name="l00508"></a>00508 <span class="preprocessor"></span>} <a name="l00509"></a>00509 <span class="preprocessor">#endif</span> <a name="l00510"></a>00510 <span class="preprocessor"></span> <a name="l00513"></a>00513 <span class="preprocessor">#endif </span><span class="comment">/* __PKCS11H_BASE_H */</span> </pre></div></div> <hr> <table width="100%"><tr><td>pkcs11-helper, Copyright (C) Alon Bar-Lev <alon.barlev@gmail.com></td><td align="right"><a href="http://www.opensc-project.org"><img src="opensc-logo.gif" alt="OpenSC-Project.org Logo" border="0"/></a></td></tr></table>