⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pkcscontainer.h

📁 PKCS#11的微软CSP实现源码
💻 H
字号:
/****************************************************************************
* 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 : container
%
% VERSION : 1.00
%
% FILE : container.h
%
% Class container : it has the parameters of a container and methods making 
% it possible to handle them
%----------------------------------------------------------------------------
% 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 PKCSCONTAINER_INCL
#define PKCSCONTAINER_INCL

#include <windows.h>
#include <cryptoki.h>

#pragma once

class PKCSContainer
{
public:
	PKCSContainer();
	~PKCSContainer();
	BOOL PKCSContainer::Initialize(CK_FUNCTION_LIST_PTR pFunctionList,CK_SLOT_ID slotID,CK_SESSION_HANDLE hSession,CK_OBJECT_HANDLE hcert,CK_BYTE_PTR cursubject,unsigned long cursubjectLen,CK_BYTE_PTR keyId,unsigned long keyIdLen,char * containerName );
	const CHAR * const GetName(){return &containerName[0];}
	bool Delete();
	CK_FUNCTION_LIST_PTR PKCSContainer::GetpFunctionList();
	void PKCSContainer::SetpFunctionList(CK_FUNCTION_LIST_PTR pFunctionList);
	CK_SLOT_ID PKCSContainer::GetslotID();
	void PKCSContainer::SetslotID(CK_SLOT_ID slotID);
	CK_SESSION_HANDLE PKCSContainer::GethSession();
	void PKCSContainer::SethSession(CK_SESSION_HANDLE hSession);
	CK_OBJECT_HANDLE PKCSContainer::Gethcert();
	void PKCSContainer::Sethcert(CK_OBJECT_HANDLE hcert);
	CK_BYTE_PTR PKCSContainer::Getcursubject();
	CK_BYTE_PTR PKCSContainer::GetkeyId();
	BOOL PKCSContainer::GetdwKeySpec(DWORD dwKeySpec);
	BOOL PKCSContainer::GetUserKey(DWORD dwKeySpec,HCRYPTKEY* phUserKey);
	
private:
	char * containerName;
	CK_FUNCTION_LIST_PTR pFunctionList;
	CK_SESSION_HANDLE hSession;
	CK_OBJECT_HANDLE hcert;
	CK_BYTE_PTR cursubject;
	CK_BYTE_PTR keyId;
	CK_SLOT_ID slotID;

};

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -