pkcs.h
资源名称:pkcs11.rar [点击查看]
上传用户:filter2008
上传日期:2013-02-01
资源大小:101k
文件大小:3k
源码类别:
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 : pkcs
- %
- % VERSION : 1.00
- %
- % FILE : pkcs.h
- %
- % cryptool: class giving access functions PKCS#11
- %----------------------------------------------------------------------------
- % Version 1.00
- %
- % CPX-31/03/2003-Creation
- %----------------------------------------------------------------------------
- */
- #ifndef PKCS_INCL
- #define PKCS_INCL
- #include <windows.h>
- #include"pkcscontainer.h"
- #include"cryptool.h"
- #pragma once
- #ifndef min
- #define min(a,b) (((a) < (b)) ? (a) : (b))
- #endif
- #ifndef max
- #define max(a,b) (((a) < (b)) ? (a) : (b))
- #endif
- #define MAX_PIN_LEN 30
- class Pkcs
- {
- public:
- Pkcs();
- ~Pkcs();
- static TableOfHandle* Pkcs::GetContainerList(){return &table_Containers;}
- static BOOL Pkcs::Initialize();
- static BOOL Pkcs::FreePkcs();
- static BOOL Pkcs::FreeContainer();
- static PKCSContainer* Pkcs::GetContainer(const CHAR IN * szContainerName);
- static BOOL Pkcs::DoSign(PKCSContainer* pContainer, unsigned long pbyHashLen, LPBYTE pbyHash,DWORD dwKeySpec, LPBYTE pbySignature, LPDWORD pdwSigLen/*,CHAR* g_strPwd*/);
- static BOOL Pkcs::CreateContainerTable();
- static BOOL Pkcs::VerifyContainerExistance(PKCSContainer* container);
- static BOOL Pkcs::Decrypt(HCRYPTKEY hPubKey, BYTE* pbySource, DWORD wSourceLength, BYTE* pbyDestination, DWORD* pwDestinationLen);
- static TableOfHandle table_Containers;
- static CK_FUNCTION_LIST_PTR pFunctionList;
- };
- #endif