亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? pkcscontainer.cpp

?? 信息安全開發使用的
?? CPP
字號:
/****************************************************************************
* 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 : PKCSContainer
%
% VERSION : 1.00
%
% FICHIER : container.cpp
%
% Class container : it has the parameters of a container and methods making 
%					it possible to handle them
%----------------------------------------------------------------------------
% Version 1.00
% 
% CPX-31/03/2003-Cr閍tion
%----------------------------------------------------------------------------
*/

/*
% Libraries ANSI or system
%------------------------------
*/
#include <windows.h>

/*
% HEADER Files include
%-----------------------
*/
#include "pkcscontainer.h"
#include "cryptool.h"




PKCSContainer::PKCSContainer() 
{
}


/*
%--------------------------------------------------------------------------
% Initialize
%
% The Initialize method is used to initialize the container object
%		 
%
% Parameters of entry :
%						IN pFunctionList	pointer on the list of functions Pkcs#11
%						IN hSession			handle on a session Pkcs#11 
%						IN hcert			handle on an object PKCS#11 certificate
%						IN cursubject		character strings corresponding to the subject of the certificate
%						IN cursubjectLen	length of the character strings above
%						IN keyId			character strings corresponding to the keyID of the certificate
%						IN keyIdLen			length of the character strings above
%						IN containerName	the name of the container
%  
% return :	TRUE if the operation occurred well, FALSE if not 
%---------------------------------------------------------------------------
*/

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 )
{

	TRACE(__LINE__,"PKCSContainer::Initialize BEGIN",NULL);
	this->pFunctionList=pFunctionList;
	this->slotID=slotID;
	this->hSession=hSession;
	this->hcert=hcert;
	this->cursubject=(CK_BYTE_PTR) malloc(cursubjectLen*sizeof(CK_BYTE));
	memcpy(this->cursubject,cursubject,cursubjectLen);
	this->keyId=(CK_BYTE_PTR) malloc(keyIdLen*sizeof(CK_BYTE));
	memcpy(this->keyId,keyId,keyIdLen);
	this->containerName=new char[strlen(containerName)];
	strcpy(this->containerName,containerName);
	
	TRACE(__LINE__,"PKCSContainer::Initialize TRUE",NULL);
	return TRUE;
}

/*
%--------------------------------------------------------------------------
% ~PKCSContainer()
%
% ~PKCSContainer() is the destructor of the container object
%---------------------------------------------------------------------------
*/
PKCSContainer::~PKCSContainer()
{
		
}

/*
%--------------------------------------------------------------------------
% Delete()
%
% Delete() destroy parameters of the container object
%		 
%						 
%  
% return :	TRUE if the operation occurred well, FALSE if not 
%---------------------------------------------------------------------------
*/
bool PKCSContainer::Delete()
{
	TRACE(__LINE__,"PKCSContainer::Delete BEGIN",NULL);
	CK_RV rv=CKR_OK; 
	
	free(this->cursubject);
	free(this->keyId);

	rv=closeSession(pFunctionList,hSession);
	if(rv!=CKR_OK)
	{
		if(rv==CKR_SESSION_HANDLE_INVALID){
			TRACE(__LINE__,"PKCSContainer::Delete TRUE",NULL);
			return true;
		}

		TRACE(__LINE__,"PKCSContainer::Delete FALSE",NULL);
		return false;
	}
	TRACE(__LINE__,"PKCSContainer::Delete TRUE",NULL);
	return true;
}

/*
%--------------------------------------------------------------------------
% GetpFunctionList()
%
% GetpFunctionList() return the pointer of function of DLL PKCS used for this container
%		 
%						 
%  
% return :	the pointer of function of DLL PKCS used for this container
%---------------------------------------------------------------------------
*/


CK_FUNCTION_LIST_PTR PKCSContainer::GetpFunctionList()
{
	return pFunctionList;
}

/*
%--------------------------------------------------------------------------
% SetpFunctionList
%
% SetpFunctionList allows to set the pointer of function of DLL PKCS used for this container
%
% Parameters of entry :
%						IN pFunctionList	pointer on the list of functions Pkcs#11 
%---------------------------------------------------------------------------
*/


void PKCSContainer::SetpFunctionList(CK_FUNCTION_LIST_PTR pFunctionList)
{
	this->pFunctionList=pFunctionList;
}



/*
%--------------------------------------------------------------------------
% GetslotID()
%
% GetslotID() returns the slotID of this container
%						 
%  
% return  :	the slotID of this container
%---------------------------------------------------------------------------
*/


CK_SLOT_ID PKCSContainer::GetslotID()
{
	return slotID;
}

/*
%--------------------------------------------------------------------------
% SetslotID
%
% SetslotID allows to set the slotID of this container
%		 
%
% Parameters of entry :
%						IN slotID	the slotID of container
%---------------------------------------------------------------------------
*/


void PKCSContainer::SetslotID(CK_SLOT_ID slotID)
{
	this->slotID=slotID;
}




/*
%--------------------------------------------------------------------------
% GethSession
%
% GethSession return the session to be used for this container
%  
% return :	the session to be used for this container
%---------------------------------------------------------------------------
*/

CK_SESSION_HANDLE PKCSContainer::GethSession()
{
	return hSession;
}

/*
%--------------------------------------------------------------------------
% SethSession
%
% SethSession allows to set the session to be used for this container
%		 
%
% Parameters of entry :
%						IN hSession the PKCS#11 session
%						 
%---------------------------------------------------------------------------
*/

void PKCSContainer::SethSession(CK_SESSION_HANDLE hSession)
{
	this->hSession=hSession;
}


/*
%--------------------------------------------------------------------------
% Gethcert
%
% Gethcert returns the handle of certificate of this container
%		 
%  
% return :	the handle of certificate of this container
%---------------------------------------------------------------------------
*/


CK_OBJECT_HANDLE PKCSContainer::Gethcert()
{
	return hcert;
}

/*
%--------------------------------------------------------------------------
% Sethcert
%
% Sethcert allows to set the handle of certificate of this container
%		 
%
% Parameters of entry :
%						 IN hcert the handle of certificate of this container
%---------------------------------------------------------------------------
*/
void PKCSContainer::Sethcert(CK_OBJECT_HANDLE hcert)
{
	this->hcert=hcert;
}


/*
%--------------------------------------------------------------------------
% Getcursubject
%
% Getcursubject returns the subject of the certificate of this container
%		 
%  
% return :	the subject of the certificate of this container
%---------------------------------------------------------------------------
*/

CK_BYTE_PTR PKCSContainer::Getcursubject()
{
	return cursubject;
}

/*
%--------------------------------------------------------------------------
% GetkeyId
%
% GetkeyId returns the ID of the key of the certificate of this container
%						 
%  
% return :	the ID of the key 
%---------------------------------------------------------------------------
*/

CK_BYTE_PTR PKCSContainer::GetkeyId()
{
	return keyId;
}

/*
%--------------------------------------------------------------------------
% GetdwKeySpec
%
% GetdwKeySpec return the type of key for this container
%		 
%
% Parameters of entry :
%						IN dwKeySpec the type of key for this container
%						 
%  
% return :	the type of key
%---------------------------------------------------------------------------
*/

BOOL PKCSContainer::GetdwKeySpec(DWORD dwKeySpec)
{
	TRACE(__LINE__,"PKCSContainer::GetdwKeySpec BEGIN",NULL);
	CK_RV rv=CKR_OK;
	CK_BBOOL bbool;
	CK_OBJECT_HANDLE phKey=NULL; 
	rv=getPublicKeyFromX509Cert(this->pFunctionList,this->hSession,&phKey ,this->hcert);
	if (rv != CKR_OK){
		TRACE(__LINE__,"PKCSContainer::GetdwKeySpec FALSE",NULL);
		return false;
	}
	if(dwKeySpec==AT_SIGNATURE)
	{
		bbool=isPubKeySupportSign(this->pFunctionList,this->hSession,phKey);
		if(bbool==TRUE){
			TRACE(__LINE__,"PKCSContainer::GetdwKeySpec TRUE",NULL);
			return TRUE;
		}
		else{
			TRACE(__LINE__,"PKCSContainer::GetdwKeySpec FALSE",NULL);
			return FALSE;
		}
			
	}
	else if(dwKeySpec==AT_KEYEXCHANGE)
	{
		bbool=isPubKeySupportEncrypt(this->pFunctionList,this->hSession,phKey);
		if(bbool==TRUE){
			TRACE(__LINE__,"PKCSContainer::GetdwKeySpec TRUE",NULL);
			return TRUE;
		}
		else{
			TRACE(__LINE__,"PKCSContainer::GetdwKeySpec FALSE",NULL);
			return FALSE;
		}
	}
	else{
		TRACE(__LINE__,"PKCSContainer::GetdwKeySpec FALSE",NULL);
		return FALSE;
	}
}



/*
%--------------------------------------------------------------------------
% GetUserKey
%
% GetUserKey returns a handle on the container
%		 
%
% Parameters of entry  :
%						IN dwKeySpec	the type of key for this container
%						OUT phUserKey	handle on the container
%  
% Valeur retourn閑 :	TRUE if the operation occurred well, FALSE if not
%---------------------------------------------------------------------------
*/

BOOL PKCSContainer::GetUserKey(DWORD dwKeySpec,HCRYPTKEY* phUserKey)
{
	TRACE(__LINE__,"PKCSContainer::GetUserKey BEGIN",NULL);
	*phUserKey=(HCRYPTKEY)this; 
	TRACE(__LINE__,"PKCSContainer::GetUserKey TRUE",NULL);
	return TRUE;
}




?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区免费在线播放| 国产乱妇无码大片在线观看| 蜜桃视频一区二区| 欧美日韩一级黄| 一区二区三区中文免费| 91亚洲大成网污www| 精品久久一区二区三区| 夜夜嗨av一区二区三区四季av | 日韩一区二区免费在线电影| 一区二区三区不卡视频| 欧美日韩一区三区| 视频一区在线播放| 精品国产1区二区| 国产传媒欧美日韩成人| 国产精品亲子伦对白| 91色视频在线| 男人的j进女人的j一区| 久久久国产一区二区三区四区小说| 激情综合色丁香一区二区| 欧美精品一区二区三区视频| 狠狠色狠狠色综合系列| 国产精品午夜在线| 在线视频国产一区| 麻豆一区二区三| 日本一区二区三区四区在线视频| 91视视频在线观看入口直接观看www | 国产欧美在线观看一区| av激情成人网| 精品亚洲成a人| 亚洲国产精品天堂| 欧美极品xxx| 日韩一区二区在线观看| 成人国产电影网| 久久精品国产澳门| 亚洲一区二区三区四区在线免费观看| 欧美美女视频在线观看| 国产在线不卡一卡二卡三卡四卡| 日本中文字幕一区二区视频 | 午夜精品在线视频一区| 欧美精品一区二区在线播放| 欧洲日韩一区二区三区| 国产在线不卡一卡二卡三卡四卡| 亚洲成人免费影院| 亚洲美女淫视频| 亚洲欧洲日韩综合一区二区| 日韩丝袜美女视频| 欧美人牲a欧美精品| 99国产精品久久久久久久久久久| 精品综合久久久久久8888| 日韩激情一二三区| 午夜精品久久久久久久| 一区二区三区日本| 亚洲精品成人少妇| 亚洲va欧美va天堂v国产综合| 亚洲欧美色图小说| 一区二区三区中文在线观看| **性色生活片久久毛片| 亚洲欧洲中文日韩久久av乱码| 中文一区一区三区高中清不卡| 国产精品欧美经典| 亚洲精品视频在线观看网站| 亚洲女与黑人做爰| 偷拍日韩校园综合在线| 奇米影视在线99精品| 狠狠色丁香婷婷综合| 99精品视频免费在线观看| 成人精品国产免费网站| 91啪亚洲精品| 欧美肥妇free| 国产欧美日韩麻豆91| 亚洲最大成人综合| 国产自产2019最新不卡| 成人性生交大片| 欧美视频在线一区| 久久夜色精品国产欧美乱极品| 精品久久99ma| 亚洲精品一二三| 国产91清纯白嫩初高中在线观看| 99精品欧美一区二区三区小说| 欧美色图免费看| 久久精品视频一区二区| 午夜成人在线视频| 9i在线看片成人免费| 欧美一区二区三区公司| 国产精品国产三级国产| 日本成人在线网站| 欧美综合在线视频| 1024精品合集| 国产综合一区二区| 色av成人天堂桃色av| 日韩午夜三级在线| 亚洲影院在线观看| 国产91精品露脸国语对白| 国产精品影视在线| 91精品久久久久久久99蜜桃| 久久精品视频在线看| 亚洲成人av一区二区三区| 国产精华液一区二区三区| 欧美日韩国产首页在线观看| 69久久99精品久久久久婷婷| 欧美日韩在线三级| 国产酒店精品激情| 91视视频在线观看入口直接观看www| 欧美在线一区二区三区| 国产午夜精品美女毛片视频| 天堂久久久久va久久久久| 91国产免费看| 国产精品三级av| 国产成人啪免费观看软件 | 中文字幕不卡的av| 国产剧情在线观看一区二区| 欧美性色欧美a在线播放| 中文字幕日本乱码精品影院| 日韩和欧美的一区| 欧美肥妇毛茸茸| 日本不卡的三区四区五区| 欧美美女网站色| 美脚の诱脚舐め脚责91 | 蜜臀av性久久久久蜜臀aⅴ四虎 | 粉嫩av一区二区三区| 久久精品亚洲一区二区三区浴池| 极品少妇一区二区三区精品视频 | 日韩欧美一卡二卡| 久久99最新地址| 中文字幕一区二区三区蜜月 | 五月天网站亚洲| 久久一二三国产| 99re6这里只有精品视频在线观看| 亚洲欧洲av另类| 91精品欧美一区二区三区综合在 | 欧美一区二区三区四区五区 | 亚洲免费观看视频| 91精品国产高清一区二区三区蜜臀 | 狠狠久久亚洲欧美| 亚洲主播在线观看| 欧美va天堂va视频va在线| 成人激情视频网站| 性做久久久久久免费观看欧美| 精品久久国产字幕高潮| 国产成人精品三级| 天堂在线亚洲视频| 国产精品久久久久久久久快鸭 | 2020国产成人综合网| 欧美在线制服丝袜| 丁香婷婷综合色啪| 美女性感视频久久| 一区二区三区不卡视频| 国产亚洲精品bt天堂精选| 欧美精品1区2区3区| 欧美在线观看18| 日韩精品在线一区| 成人av在线看| 成人av电影观看| 国产精品一卡二卡| 中文在线免费一区三区高中清不卡| 欧美日韩国产在线播放网站| 91在线精品一区二区| 成人免费视频app| 国产成人无遮挡在线视频| 狠狠色丁香久久婷婷综合丁香| 亚洲激情男女视频| 国产午夜精品一区二区三区视频| 亚洲精品一区二区三区影院| 欧美成人免费网站| 久久影音资源网| 久久久久久99久久久精品网站| 欧美大白屁股肥臀xxxxxx| 色中色一区二区| 欧美三级三级三级| 91小视频免费观看| 欧美视频第二页| 日韩免费性生活视频播放| 欧美精品一区二区三区蜜桃| 国产无一区二区| 亚洲国产精品成人久久综合一区| 国产精品久久久久影院亚瑟 | 亚洲免费av高清| 午夜精品久久一牛影视| 亚洲444eee在线观看| 精品制服美女丁香| 色综合天天综合网天天狠天天| 欧美影院午夜播放| 欧美电视剧免费观看| 亚洲欧美国产高清| 麻豆精品新av中文字幕| 成人精品国产免费网站| 欧美日本视频在线| 中文字幕永久在线不卡| 久久精品72免费观看| 91天堂素人约啪| 国产欧美综合在线观看第十页 | 欧美日韩精品三区| 国产精品女人毛片| 精品无人区卡一卡二卡三乱码免费卡| 国产91精品免费| 精品久久五月天| 午夜精品久久久久久久久久| 97成人超碰视| 国产精品色在线| 狠狠色综合色综合网络|