資源簡介
飛天誠信的epass300的資源包,包括windows和其它系統下的應用。
代碼片段和文件信息
#include
#include?
#include?
#include?“../../include/cryptoki_ft.h“
#include?“enumobj.h“
using?namespace?std;
EnumObj::EnumObj()
{
m_pSlotList?=?NULL_PTR;
m_pApplication?=?new?char[255];
memset(m_pApplication?0?255);
strcpy((char*)m_pApplication?“Enum?object?App“);
m_hSession?=?NULL_PTR;
}
EnumObj::~EnumObj()
{
if(m_hSession)
{
C_CloseSession(m_hSession);
m_hSession?=?NULL_PTR;
}
delete[]?(char?*)m_pApplication;
if(m_pSlotList)
{
delete[]?m_pSlotList;
m_pSlotList?=?NULL_PTR;
}
}
CK_RV?EnumObj::Connect()?
{
if(m_hSession)?return?CKR_OK;
CK_RV?rv;
CK_ULONG?ulCount?=?0;
rv?=?C_GetSlotList(TRUE?NULL_PTR?&ulCount);
if(CKR_OK?!=?rv?)
{
printf(“\nCan‘t?Acquire?the?Inoformation?of?Token.Error?Code?0x%08X.\n“?rv);
return?rv;
}
if(0?>=?ulCount)
{
printf(“\nCan‘t?Connect?to?Token.Make?Sure?You?have?inserted?USB?Token.\n“);
return?CKR_GENERAL_ERROR;
}
m_pSlotList?=?(CK_SLOT_ID_PTR)new?CK_SLOT_ID[ulCount];
if?(!?m_pSlotList)?
{
printf(“\nCan‘t?allocate?enough?memory\n“);
return?CKR_HOST_MEMORY;
}
rv?=?C_GetSlotList(TRUE?m_pSlotList?&ulCount);
if(CKR_OK?!=?rv?)
{
printf(“\nCan‘t?Acquire?the?Inoformation?of?Token.Error?Code?0x%08X.\n“?rv);
return?rv;
}
if(0?>=?ulCount)
{
printf(“\nCan‘t?Connect?to?Token.Make?Sure?You?have?inserted?Token.\n“);
return?CKR_HOST_MEMORY;
}
rv?=?C_OpenSession(
m_pSlotList[0]??CKF_RW_SESSION?|?CKF_SERIAL_SESSION
&m_pApplication?NULL_PTR?&m_hSession);
if(CKR_OK?!=?rv?)
{
printf(“\nCan‘t?Connect?to?Token.Error?Code?0x%08X.\n“?rv);
delete[]?m_pSlotList;
m_pSlotList?=?NULL_PTR;
return?rv;
}
else
{
printf(“Success?connect?to?Token\n“);
return?CKR_OK;
}
}
void?EnumObj::StartOP()
{
printf(“\n================================================“);
}
void?EnumObj::Enum()?
{
CK_object_CLASS?dataClass?=?CKO_CERTIFICATE;
bool?IsToken=true;
CK_ATTRIBUTE?pTempl[]?=?
{
{CKA_CLASS?&dataClass?sizeof(CKO_CERTIFICATE)}
{CKA_TOKEN?&IsToken?sizeof(true)}
};
C_FindobjectsInit(m_hSession?pTempl?2);
CK_object_HANDLE?hCKObj;
CK_ULONG?ulRetCount?=?0;
CK_RV?ckrv?=?0;
int?numObj=0;
do
{
ckrv?=?C_Findobjects(m_hSession?&hCKObj?1?&ulRetCount);
if(CKR_OK?!=?ckrv)
{
break;
}
if(1?!=?ulRetCount)
break;
CK_ATTRIBUTE?pAttrTemp[]?=?
{
{CKA_CLASS?NULL?0}
{CKA_CERTIFICATE_TYPENULL0}
{CKA_LABEL?NULL?0}
{CKA_SUBJECTNULL0}
{CKA_IDNULL0}
{CKA_VALUENULL0}
};
ckrv?=?C_GetAttributeValue(m_hSession?hCKObj?pAttrTemp?6);
if(ckrv?!=?CKR_OK)
{
break;
}
pAttrTemp[0].pValue?=?new?char[pAttrTemp[0].ulValueLen];
pAttrTemp[1].pValue?=?new?char[pAttrTemp[1].ulValueLen];
pAttrTemp[2].pValue?=?new?char[pAttrTemp[2].ulValueLen+1];
pAttrTemp[3].pValue?=?new?char[pAttrTemp[3].ulValueLen+1];
pAttrTemp[4].
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
????.CA....?????54582??2009-07-15?17:08??ePass3000\Linux1.1\doc\ePass3000_Hardware_Desc
????.CA....????155217??2009-07-15?17:08??ePass3000\Linux1.1\doc\ePass3000_RunTime_Package_Installation_Guide.pdf
????.CA....???1217672??2009-08-10?09:37??ePass3000\Linux1.1\doc\ePassNG_User_Manual.pdf
????.CA....??????2065??2009-07-02?10:13??ePass3000\Linux1.1\include\auxiliary.h
????.CA....??????1705??2009-07-02?10:13??ePass3000\Linux1.1\include\cryptoki_ft.h
????.CA....??????1436??2009-07-02?10:13??ePass3000\Linux1.1\include\cryptoki_linux.h
????.CA....??????2505??2009-07-02?10:13??ePass3000\Linux1.1\include\notifymsg.h
????.CA....??????9578??2009-07-02?10:13??ePass3000\Linux1.1\include\pkcs11.h
????.CA....?????29258??2009-07-02?10:13??ePass3000\Linux1.1\include\pkcs11f.h
????.CA....?????54529??2009-07-02?10:13??ePass3000\Linux1.1\include\pkcs11t.h
????.CA....???3717322??2009-08-10?17:31??ePass3000\Linux1.1\redist\EnterSafe-ePass3000-1.1.0.090810.x86.tar.gz
????.CA....?????22347??2009-07-02?10:13??ePass3000\Linux1.1\sample\EnumObj\enumobj.cpp
????.CA....???????389??2009-07-02?10:13??ePass3000\Linux1.1\sample\EnumObj\enumobj.h
????.CA....??????1403??2009-07-02?10:13??ePass3000\Linux1.1\sample\EnumObj\main.cpp
????.CA....???????132??2009-07-02?10:13??ePass3000\Linux1.1\sample\EnumObj\Makefile
????.CA....??????4712??2009-08-04?14:47??ePass3000\Linux1.1\sample\ExportCert\exportcert.cpp
????.CA....???????298??2009-07-02?10:13??ePass3000\Linux1.1\sample\ExportCert\exportcert.h
????.CA....???????451??2009-07-02?10:13??ePass3000\Linux1.1\sample\ExportCert\main.cpp
????.CA....???????140??2009-07-02?10:13??ePass3000\Linux1.1\sample\ExportCert\Makefile
????.CA....??????2373??2009-07-02?10:13??ePass3000\Linux1.1\sample\GetPinInfo\GetPinInfo.cpp
????.CA....???????301??2009-07-02?10:13??ePass3000\Linux1.1\sample\GetPinInfo\GetPinInfo.h
????.CA....???????428??2009-07-02?10:13??ePass3000\Linux1.1\sample\GetPinInfo\main.cpp
????.CA....???????136??2009-07-02?10:13??ePass3000\Linux1.1\sample\GetPinInfo\Makefile
????.CA....??????1907??2009-08-04?16:02??ePass3000\Linux1.1\sample\GetTimer\GetTimer.cpp
????.CA....???????287??2009-07-02?10:13??ePass3000\Linux1.1\sample\GetTimer\GetTimer.h
????.CA....???????424??2009-07-02?10:13??ePass3000\Linux1.1\sample\GetTimer\main.cpp
????.CA....???????136??2009-07-02?10:13??ePass3000\Linux1.1\sample\GetTimer\Makefile
????.CA....??????2464??2009-07-02?10:13??ePass3000\Linux1.1\sample\GetTokenInfo\main.cpp
????.CA....???????131??2009-07-02?10:13??ePass3000\Linux1.1\sample\GetTokenInfo\Makefile
????.CA....??????7409??2009-07-02?10:13??ePass3000\Linux1.1\sample\GetUSBInfos\getinfos.cpp
............此處省略374個文件信息
- 上一篇:intraFace人臉對齊
- 下一篇:draw.io Windows桌面版
評論
共有 條評論