淘宝买的epass2001 ukey,然后附带的开发指南,里面有三平台通用的开发工具,以及证书管理工具,可以进行导入,导出,但是私钥没办法进行导出,因为ukey本身安全性限制
代码片段和文件信息
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
.CA.... 3907 2009-04-03 17:13 ePass2001linux1.0configconfig.sh
.CA.... 1299 2009-04-03 17:13 ePass2001linux1.0configunconfig.sh
.CA.... 11884 2009-04-03 17:13 ePass2001linux1.0docslicense_en.rtf
.CA.... 779488 2009-04-03 17:15 ePass2001linux1.0docsShuttle_UserGuide.pdf
.CA.... 1722 2009-04-03 17:14 ePass2001linux1.0
eadme
.CA.... 5626 2009-04-03 17:13 ePass2001linux1.0
edistlangpkimanager_1033.lng
.CA.... 11070 2009-04-03 17:13 ePass2001linux1.0
edistlangpkimanager_2052.lng
.CA..H. 9 2009-08-12 09:02 ePass2001linux1.0
edistlang\_desktop.ini
.CA.... 2505968 2009-04-03 17:13 ePass2001linux1.0
edistlibshuttle_p11v220.so.1.0.0
.CA.... 4529760 2009-04-03 17:13 ePass2001linux1.0
edistpkimanager
.CA.... 4530112 2009-04-03 17:13 ePass2001linux1.0
edistpkimanager_admin
.CA.... 9752 2009-04-03 17:13 ePass2001linux1.0sampleincludeauxiliary.h
.CA.... 2112 2009-04-03 17:13 ePass2001linux1.0sampleincludecryptoki.h
.CA.... 2479 2009-04-03 17:13 ePass2001linux1.0sampleincludecryptoki_ext.h
.CA.... 1436 2009-04-03 17:13 ePass2001linux1.0sampleincludecryptoki_linux.h
.CA.... 2110 2009-04-03 17:13 ePass2001linux1.0sampleincludecryptoki_win32.h
.CA.... 9578 2009-04-03 17:13 ePass2001linux1.0sampleincludepkcs11.h
.CA.... 29258 2009-04-03 17:13 ePass2001linux1.0sampleincludepkcs11f.h
.CA.... 70934 2009-04-03 17:13 ePass2001linux1.0sampleincludepkcs11t.h
.CA.... 22053 2009-04-03 17:13 ePass2001linux1.0samplesourceEnumObjenumobj.cpp
.CA.... 389 2009-04-03 17:13 ePass2001linux1.0samplesourceEnumObjenumobj.h
.CA.... 1401 2009-04-03 17:13 ePass2001linux1.0samplesourceEnumObjmain.cpp
.CA.... 209 2009-04-03 17:13 ePass2001linux1.0samplesourceEnumObjMakefile
.CA..H. 9 2009-08-12 09:02 ePass2001linux1.0samplesourceEnumObj\_desktop.ini
.CA.... 4441 2009-04-03 17:13 ePass2001linux1.0samplesourceExportCertexportcert.cpp
.CA.... 298 2009-04-03 17:13 ePass2001linux1.0samplesourceExportCertexportcert.h
.CA.... 447 2009-04-03 17:13 ePass2001linux1.0samplesourceExportCertmain.cpp
.CA.... 218 2009-04-03 17:13 ePass2001linux1.0samplesourceExportCertMakefile
.CA..H. 9 2009-08-12 09:02 ePass2001linux1.0samplesourceExportCert\_desktop.ini
.CA.... 2412 2009-04-03 17:13 ePass2001linux1.0samplesourceGetPinInfoGetPinInfo.cpp
............此处省略272个文件信息
#include
#include
#include
#include “../../include/cryptoki_ext.h“
#include “enumobj.h“
using namespace std;
EnumObj::EnumObj()
{
m_pSlotList = NULL_PTR;
m_hSession = NULL_PTR;
}
EnumObj::~EnumObj()
{
if(m_hSession)
{
C_CloseSession(m_hSession);
m_hSession = NULL_PTR;
}
if(m_pSlotList)
{
delete[] m_pSlotList;
m_pSlotList = NULL_PTR;
}
}
CK_RV EnumObj::Connect()
{
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
NULL_PTR 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].pValue = new char[pAttrTemp[4].ulValueLen+1];
pAttrTemp[5].pValue = new char[pAttrTemp[5].ulValueLen ];
memset(pAttrTemp[0].pValue 0 pAttrTemp[0].ulValueLen);
memset(pAttrTemp[1].pV
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
.CA.... 3907 2009-04-03 17:13 ePass2001linux1.0configconfig.sh
.CA.... 1299 2009-04-03 17:13 ePass2001linux1.0configunconfig.sh
.CA.... 11884 2009-04-03 17:13 ePass2001linux1.0docslicense_en.rtf
.CA.... 779488 2009-04-03 17:15 ePass2001linux1.0docsShuttle_UserGuide.pdf
.CA.... 1722 2009-04-03 17:14 ePass2001linux1.0
eadme
.CA.... 5626 2009-04-03 17:13 ePass2001linux1.0
edistlangpkimanager_1033.lng
.CA.... 11070 2009-04-03 17:13 ePass2001linux1.0
edistlangpkimanager_2052.lng
.CA..H. 9 2009-08-12 09:02 ePass2001linux1.0
edistlang\_desktop.ini
.CA.... 2505968 2009-04-03 17:13 ePass2001linux1.0
edistlibshuttle_p11v220.so.1.0.0
.CA.... 4529760 2009-04-03 17:13 ePass2001linux1.0
edistpkimanager
.CA.... 4530112 2009-04-03 17:13 ePass2001linux1.0
edistpkimanager_admin
.CA.... 9752 2009-04-03 17:13 ePass2001linux1.0sampleincludeauxiliary.h
.CA.... 2112 2009-04-03 17:13 ePass2001linux1.0sampleincludecryptoki.h
.CA.... 2479 2009-04-03 17:13 ePass2001linux1.0sampleincludecryptoki_ext.h
.CA.... 1436 2009-04-03 17:13 ePass2001linux1.0sampleincludecryptoki_linux.h
.CA.... 2110 2009-04-03 17:13 ePass2001linux1.0sampleincludecryptoki_win32.h
.CA.... 9578 2009-04-03 17:13 ePass2001linux1.0sampleincludepkcs11.h
.CA.... 29258 2009-04-03 17:13 ePass2001linux1.0sampleincludepkcs11f.h
.CA.... 70934 2009-04-03 17:13 ePass2001linux1.0sampleincludepkcs11t.h
.CA.... 22053 2009-04-03 17:13 ePass2001linux1.0samplesourceEnumObjenumobj.cpp
.CA.... 389 2009-04-03 17:13 ePass2001linux1.0samplesourceEnumObjenumobj.h
.CA.... 1401 2009-04-03 17:13 ePass2001linux1.0samplesourceEnumObjmain.cpp
.CA.... 209 2009-04-03 17:13 ePass2001linux1.0samplesourceEnumObjMakefile
.CA..H. 9 2009-08-12 09:02 ePass2001linux1.0samplesourceEnumObj\_desktop.ini
.CA.... 4441 2009-04-03 17:13 ePass2001linux1.0samplesourceExportCertexportcert.cpp
.CA.... 298 2009-04-03 17:13 ePass2001linux1.0samplesourceExportCertexportcert.h
.CA.... 447 2009-04-03 17:13 ePass2001linux1.0samplesourceExportCertmain.cpp
.CA.... 218 2009-04-03 17:13 ePass2001linux1.0samplesourceExportCertMakefile
.CA..H. 9 2009-08-12 09:02 ePass2001linux1.0samplesourceExportCert\_desktop.ini
.CA.... 2412 2009-04-03 17:13 ePass2001linux1.0samplesourceGetPinInfoGetPinInfo.cpp
............此处省略272个文件信息
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。
评论列表(条)