00001 /* 00002 * Copyright (c) 2005-2008 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_DATA_H 00068 #define __PKCS11H_DATA_H 00069 00070 #include <pkcs11-helper-1.0/pkcs11h-core.h> 00071 00072 #if defined(__cplusplus) 00073 extern "C" { 00074 #endif 00075 00076 struct pkcs11h_data_id_list_s; 00077 00081 typedef struct pkcs11h_data_id_list_s *pkcs11h_data_id_list_t; 00082 00086 struct pkcs11h_data_id_list_s { 00088 pkcs11h_data_id_list_t next; 00089 00091 char *application; 00093 char *label; 00094 }; 00095 00109 CK_RV 00110 pkcs11h_data_get ( 00111 IN const pkcs11h_token_id_t token_id, 00112 IN const PKCS11H_BOOL is_public, 00113 IN const char * const application, 00114 IN const char * const label, 00115 IN void * const user_data, 00116 IN const unsigned mask_prompt, 00117 OUT unsigned char * const blob, 00118 IN OUT size_t * const p_blob_size 00119 ); 00120 00133 CK_RV 00134 pkcs11h_data_put ( 00135 IN const pkcs11h_token_id_t token_id, 00136 IN const PKCS11H_BOOL is_public, 00137 IN const char * const application, 00138 IN const char * const label, 00139 IN void * const user_data, 00140 IN const unsigned mask_prompt, 00141 OUT unsigned char * const blob, 00142 IN const size_t blob_size 00143 ); 00144 00155 CK_RV 00156 pkcs11h_data_del ( 00157 IN const pkcs11h_token_id_t token_id, 00158 IN const PKCS11H_BOOL is_public, 00159 IN const char * const application, 00160 IN const char * const label, 00161 IN void * const user_data, 00162 IN const unsigned mask_prompt 00163 ); 00164 00170 CK_RV 00171 pkcs11h_data_freeDataIdList ( 00172 IN const pkcs11h_data_id_list_t data_id_list 00173 ); 00174 00185 CK_RV 00186 pkcs11h_data_enumDataObjects ( 00187 IN const pkcs11h_token_id_t token_id, 00188 IN const PKCS11H_BOOL is_public, 00189 IN void * const user_data, 00190 IN const unsigned mask_prompt, 00191 OUT pkcs11h_data_id_list_t * const p_data_id_list 00192 ); 00193 00194 #ifdef __cplusplus 00195 } 00196 #endif 00197 00200 #endif /* __PKCS11H_DATA_H */
pkcs11-helper, Copyright (C) Alon Bar-Lev <alon.barlev@gmail.com> | ![]() |