cryptool.h
资源名称:pkcs11.rar [点击查看]
上传用户:filter2008
上传日期:2013-02-01
资源大小:101k
文件大小:4k
源码类别:
CA认证
开发平台:
C/C++
- /****************************************************************************
- * library : pkcs_csp.dll
- * Purpose : It is a cryptographic service provider which is an independent
- * software module that actually performs cryptography algorithms for
- * authentication, encoding, and encryption.
- * This DLL can be interfaced on any PKCS#11 module.
- *
- * Copyright (C) 2003 Ilex Syst鑝es Informatiques
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * Contact :
- * Ilex
- * 51 boulevard Voltaire
- * 92600 Asni鑢es-sur-Seine
- * pkizy@ilex.fr
- *
- * Author: Delouvrier Antoine
- *
- *******************************************************************************/
- /*
- %----------------------------------------------------------------------------
- % PROJECT : CSP_PKCS
- %
- % MODULE : cryptool
- %
- % VERSION : 1.00
- %
- % FILE : cryptool.h
- %
- % cryptool: Functions allowing various accesses to the PKCS#11
- %----------------------------------------------------------------------------
- % Version 1.00
- %
- % CPX-31/03/2003-Creation
- %----------------------------------------------------------------------------
- % You can find cryptoki.h, pkcs11.h, pkcs11f.h and pkcs11t.h at the adress :
- % http://www.rsasecurity.com/rsalabs/pkcs/pkcs-11/
- */
- #ifndef CRYPTOOL_INCL
- #define CRYPTOOL_INCL
- #include <cryptoki.h>
- #define CSP_PKCS11_INI "csp_pkcs.ini"
- #define SECTION_PKCS_NAME "CSP_PKCS"
- #define SECTION_PKCS_TRACE "CSP_PKCS_TRACE"
- #define KEY_PKCS_NAME "Name"
- #define KEY_LEVEL "Level"
- void TRACE(CK_ULONG line , char CK_PTR msg,...);
- int getTraceLevel();
- void setTraceLevel();
- CK_RV init(CK_FUNCTION_LIST_PTR CK_PTR);
- CK_RV cleanup(CK_FUNCTION_LIST_PTR);
- CK_RV initialize(CK_FUNCTION_LIST_PTR, char * );
- CK_BBOOL isPubKeySupportSign(CK_FUNCTION_LIST_PTR , CK_SESSION_HANDLE , CK_OBJECT_HANDLE );
- CK_BBOOL isPubKeySupportEncrypt(CK_FUNCTION_LIST_PTR , CK_SESSION_HANDLE , CK_OBJECT_HANDLE );
- CK_RV getKeyFromX509Cert(CK_FUNCTION_LIST_PTR , CK_SESSION_HANDLE , CK_OBJECT_HANDLE_PTR ,CK_OBJECT_HANDLE,CK_OBJECT_CLASS , int );
- CK_RV getX509KeyId(CK_FUNCTION_LIST_PTR , CK_SESSION_HANDLE , CK_OBJECT_HANDLE ,CK_BYTE_PTR , CK_ULONG_PTR );
- CK_RV getX509Subject(CK_FUNCTION_LIST_PTR, CK_SESSION_HANDLE, CK_OBJECT_HANDLE,CK_BYTE_PTR, CK_ULONG_PTR);
- CK_RV login(CK_FUNCTION_LIST_PTR , CK_SESSION_HANDLE , CK_CHAR_PTR , CK_ULONG);
- CK_RV logout(CK_FUNCTION_LIST_PTR , CK_SESSION_HANDLE );
- CK_RV getAllX509CertificateList(CK_FUNCTION_LIST_PTR , CK_SESSION_HANDLE, CK_OBJECT_HANDLE_PTR, CK_ULONG_PTR );
- CK_RV getCertListFromAttr(CK_FUNCTION_LIST_PTR , CK_SESSION_HANDLE , CK_ATTRIBUTE_PTR , CK_ULONG , CK_OBJECT_HANDLE_PTR, CK_ULONG_PTR );
- CK_RV getKeyType(CK_FUNCTION_LIST_PTR , CK_SESSION_HANDLE , CK_OBJECT_HANDLE ,CK_KEY_TYPE * );
- CK_RV getPublicKeyFromX509Cert(CK_FUNCTION_LIST_PTR , CK_SESSION_HANDLE, CK_OBJECT_HANDLE_PTR , CK_OBJECT_HANDLE );
- CK_RV getPrivateKeyFromX509Cert(CK_FUNCTION_LIST_PTR , CK_SESSION_HANDLE , CK_OBJECT_HANDLE_PTR , CK_OBJECT_HANDLE );
- CK_RV getSlotListWithToken(CK_FUNCTION_LIST_PTR , CK_SLOT_ID_PTR , CK_ULONG_PTR );
- CK_RV getX509Value(CK_FUNCTION_LIST_PTR, CK_SESSION_HANDLE, CK_OBJECT_HANDLE ,CK_BYTE_PTR, CK_ULONG_PTR);
- CK_RV sign(CK_FUNCTION_LIST_PTR, CK_SESSION_HANDLE , CK_OBJECT_HANDLE , CK_BYTE_PTR , CK_ULONG, CK_BYTE_PTR, CK_ULONG_PTR,CK_ULONG);
- CK_RV decrypt(CK_FUNCTION_LIST_PTR , CK_SESSION_HANDLE, CK_OBJECT_HANDLE, CK_BYTE_PTR, CK_ULONG_PTR,CK_BYTE_PTR,CK_ULONG_PTR);
- CK_RV getModulusBits(CK_FUNCTION_LIST_PTR pFunctionList, CK_SESSION_HANDLE hSession, CK_OBJECT_HANDLE hKey, CK_ULONG_PTR pModulusBits);
- CK_RV openSession(CK_FUNCTION_LIST_PTR , CK_SLOT_ID , CK_SESSION_HANDLE_PTR );
- CK_RV closeSession(CK_FUNCTION_LIST_PTR , CK_SESSION_HANDLE);
- #endif