如何在.net for using method中使用gemalto智能卡(axaltocm.dll)的微型驱动程序
void ChangeReferenceData(byte mode, byte role, byte[] oldPin,byte[] newPin, int maxTries);我已经从windows更新安装了gelamto minidriver。
基本上,我想使用ChangeReferenceData方法更改管理员密钥。
请帮帮忙。
发布于 2013-06-13 22:59:32
您可以安装Gemalto SDK http://www.gemalto.com/products/dotnet_card/resources/development.html
添加CardModule_stub.dll作为引用
使用MSCM服务:
自发现服务= (CardModuleService)Activator.GetObject(typeof(CardModuleService),@“apdu:// CardModuleService /MSCM”)
service.ChangeReferenceData(.......)
发布于 2015-04-03 00:31:48
我对更改管理密钥(在Gemalto IDPrime.Net智能卡上)的解决方案是:
byte[] ch = service.GetChallenge();
String sData = BitConverter.ToString(ch).Replace("-", "");
byte[] bResp = Encrypt("000000000000000000000000000000000000000000000000", "0000000000000000", sData);//key, and iv
service.ExternalAuthenticate(bResp);
if (service.IsAuthenticated(2))//2-Admin,1-User
{
byte[] ch1 = service.GetChallenge();
String sData1 = BitConverter.ToString(ch1).Replace("-", "");
byte[] bResp1 = Encrypt("000000000000000000000000000000000000000000000000", "0000000000000000", sData1);
service.ChangeReferenceData(0, 2, bResp1, b_newpin , -1);//for Admin PIN
//service.ChangeReferenceData(0, 1, Encoding.ASCII.GetBytes(userpin), Encoding.ASCII.GetBytes("0001"), -1);//for User PIN
} 发布于 2013-06-03 19:30:38
您不能将dll引用导入到您的项目中吗?如果dll是非托管代码(例如,c++),您必须使用dllimport。http://msdn.microsoft.com/en-us/library/aa288468(v=vs.71).aspx。否则,您只需添加引用。
https://stackoverflow.com/questions/16895682
复制相似问题