cryptool.h
资源名称:pkcs11.rar [点击查看]
上传用户:filter2008
上传日期:2013-02-01
资源大小:101k
文件大小:3k
源码类别:
CA认证
开发平台:
C/C++
- #ifndef _CRYPTOOL_HEADER_
- #define _CRYPTOOL_HEADER_
- #include "cryptoki.h"
- #include "wincrypt.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_local(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 isPrivKeySupportSign(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 getX509Label(CK_FUNCTION_LIST_PTR , CK_SESSION_HANDLE , CK_OBJECT_HANDLE ,CK_BYTE_PTR , CK_ULONG_PTR );
- CK_RV getX509Issuer(CK_FUNCTION_LIST_PTR pFunctionList, CK_SESSION_HANDLE hSession, CK_OBJECT_HANDLE hCert,CK_BYTE_PTR issuer, CK_ULONG_PTR pIssuerLen);
- 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 waitForSlotEvent(CK_FUNCTION_LIST_PTR pFunctionList, CK_SLOT_ID_PTR pSlotId);
- CK_RV getSlotList(CK_FUNCTION_LIST_PTR pFunctionList, CK_SLOT_ID_PTR pSlotList, CK_ULONG_PTR pSlotListSize);
- CK_RV openSession(CK_FUNCTION_LIST_PTR , CK_SLOT_ID , CK_SESSION_HANDLE_PTR );
- CK_RV closeSession(CK_FUNCTION_LIST_PTR , CK_SESSION_HANDLE);
- bool propCert(char * containerName,unsigned char * valuecert,unsigned long valuecertLen);
- bool propCertChain(CK_FUNCTION_LIST_PTR pFunctionList, CK_SESSION_HANDLE hSession, CK_OBJECT_HANDLE hCert,unsigned char * valuecert,unsigned long valuecertLen);
- #endif