epass3000开发包


飞天诚信的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(“
Can‘t Acquire the Inoformation of Token.Error Code 0x%08X.
“ rv);
return rv;
}
if(0 >= ulCount)
{
printf(“
Can‘t Connect to Token.Make Sure You have inserted USB Token.
“);
return CKR_GENERAL_ERROR;
}

m_pSlotList = (CK_SLOT_ID_PTR)new CK_SLOT_ID[ulCount];
if (! m_pSlotList) 
{
printf(“
Can‘t allocate enough memory
“);
return CKR_HOST_MEMORY;
}

rv = C_GetSlotList(TRUE m_pSlotList &ulCount);
if(CKR_OK != rv )
{
printf(“
Can‘t Acquire the Inoformation of Token.Error Code 0x%08X.
“ rv);
return rv;
}
if(0 >= ulCount)
{
printf(“
Can‘t Connect to Token.Make Sure You have inserted Token.
“);
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(“
Can‘t Connect to Token.Error Code 0x%08X.
“ rv);
delete[] m_pSlotList;
m_pSlotList = NULL_PTR;
return rv;
}
else
{
printf(“Success connect to Token
“);
return CKR_OK;
}
}

void EnumObj::StartOP()
{
printf(“
================================================“);
}

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  ePass3000Linux1.1docePass3000_Hardware_Description.pdf

    .CA....    155217  2009-07-15 17:08  ePass3000Linux1.1docePass3000_RunTime_Package_Installation_Guide.pdf

    .CA....   1217672  2009-08-10 09:37  ePass3000Linux1.1docePassNG_User_Manual.pdf

    .CA....      2065  2009-07-02 10:13  ePass3000Linux1.1includeauxiliary.h

    .CA....      1705  2009-07-02 10:13  ePass3000Linux1.1includecryptoki_ft.h

    .CA....      1436  2009-07-02 10:13  ePass3000Linux1.1includecryptoki_linux.h

    .CA....      2505  2009-07-02 10:13  ePass3000Linux1.1include
otifymsg.h

    .CA....      9578  2009-07-02 10:13  ePass3000Linux1.1includepkcs11.h

    .CA....     29258  2009-07-02 10:13  ePass3000Linux1.1includepkcs11f.h

    .CA....     54529  2009-07-02 10:13  ePass3000Linux1.1includepkcs11t.h

    .CA....   3717322  2009-08-10 17:31  ePass3000Linux1.1
edistEnterSafe-ePass3000-1.1.0.090810.x86.tar.gz

    .CA....     22347  2009-07-02 10:13  ePass3000Linux1.1sampleEnumObjenumobj.cpp

    .CA....       389  2009-07-02 10:13  ePass3000Linux1.1sampleEnumObjenumobj.h

    .CA....      1403  2009-07-02 10:13  ePass3000Linux1.1sampleEnumObjmain.cpp

    .CA....       132  2009-07-02 10:13  ePass3000Linux1.1sampleEnumObjMakefile

    .CA....      4712  2009-08-04 14:47  ePass3000Linux1.1sampleExportCertexportcert.cpp

    .CA....       298  2009-07-02 10:13  ePass3000Linux1.1sampleExportCertexportcert.h

    .CA....       451  2009-07-02 10:13  ePass3000Linux1.1sampleExportCertmain.cpp

    .CA....       140  2009-07-02 10:13  ePass3000Linux1.1sampleExportCertMakefile

    .CA....      2373  2009-07-02 10:13  ePass3000Linux1.1sampleGetPinInfoGetPinInfo.cpp

    .CA....       301  2009-07-02 10:13  ePass3000Linux1.1sampleGetPinInfoGetPinInfo.h

    .CA....       428  2009-07-02 10:13  ePass3000Linux1.1sampleGetPinInfomain.cpp

    .CA....       136  2009-07-02 10:13  ePass3000Linux1.1sampleGetPinInfoMakefile

    .CA....      1907  2009-08-04 16:02  ePass3000Linux1.1sampleGetTimerGetTimer.cpp

    .CA....       287  2009-07-02 10:13  ePass3000Linux1.1sampleGetTimerGetTimer.h

    .CA....       424  2009-07-02 10:13  ePass3000Linux1.1sampleGetTimermain.cpp

    .CA....       136  2009-07-02 10:13  ePass3000Linux1.1sampleGetTimerMakefile

    .CA....      2464  2009-07-02 10:13  ePass3000Linux1.1sampleGetTokenInfomain.cpp

    .CA....       131  2009-07-02 10:13  ePass3000Linux1.1sampleGetTokenInfoMakefile

    .CA....      7409  2009-07-02 10:13  ePass3000Linux1.1sampleGetUSBInfosgetinfos.cpp

............此处省略374个文件信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)