我试图使用CryptoTokenKit读取OSX上智能卡的主文件,但我总是得到状态词6d00作为响应。我还尝试使用一些修改来运行琐碎例子,但得到了相同的错误。我的读者是Gemalto PC双阅读器。
如果你有什么建议,请告诉我。
我使用以下代码:
TKSmartCardSlot *slot = [self.smartCardManager slotWithName:slotName];
TKSmartCard *card = [slot makeSmartCard];
card.sensitive = YES;
[card beginSessionWithReply:^(BOOL success, NSError *error) {
NSLog(@"%@", error);
NSLog(@"Proto: %ld", card.currentProtocol);
NSData *data = [CommonUtil dataFromHexString:@"3F00"]; //<3f00>
NSLog(@"%@", data);
[card sendIns:0xA4 p1:0x00 p2:0x00 data:data le:@0
reply:^(NSData *replyData, UInt16 sw, NSError *error)
{
NSLog(@"Response: %@", replyData);
if (error) {
if (error.code == TKErrorCodeCommunicationError) {
// set response error code.
}
NSLog(@"%@", error);
}
}];
}];发布于 2015-07-04 18:11:05
这是很愚蠢的,但是在apdu中,如果没有成功代码90 00,就没有预期的响应数据,le应该是nil。
[card sendIns:0xA4 p1:0x00 p2:0x00 data:nil le:nil
reply:^(NSData *replyData, UInt16 sw, NSError *error)
{
}发布于 2015-09-18 14:36:47
状态字6D00是“不支持或无效的指令代码”organizations.aspx
并非所有卡都允许选择主文件(0x3F00)。
https://stackoverflow.com/questions/31220795
复制相似问题