Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Macos OSX CryptokenKit智能卡返回错误6d00_Macos_Smartcard_Pcsc - Fatal编程技术网

Macos OSX CryptokenKit智能卡返回错误6d00

Macos OSX CryptokenKit智能卡返回错误6d00,macos,smartcard,pcsc,Macos,Smartcard,Pcsc,我试图使用CryptokenKit读取OSX上智能卡的主文件,但我总是得到statusword6d00作为响应。我还尝试运行了一些修改,但得到了相同的错误。我的阅读器是Gemalto PC Twin reader 请让我知道,如果你有任何建议来解决它 我正在使用以下代码: TKSmartCardSlot *slot = [self.smartCardManager slotWithName:slotName]; TKSmartCard *card = [slot makeSmar

我试图使用CryptokenKit读取OSX上智能卡的主文件,但我总是得到statusword
6d00
作为响应。我还尝试运行了一些修改,但得到了相同的错误。我的阅读器是Gemalto PC Twin reader

请让我知道,如果你有任何建议来解决它

我正在使用以下代码:

    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);
             }
         }];
    }];
TKSmartCardSlot*slot=[self.smartCardManager slotWithName:slotName];
TKSmartCard*卡=[插槽制作智能卡];
card.sensitive=是;
[card beginSessionWithReply:^(布尔成功,N错误*错误){
NSLog(@“%@”,错误);
NSLog(@“Proto:%ld”,card.currentProtocol);
NSData*data=[CommonUtil dataFromHexString:@“3F00”]//
NSLog(@“%@”,数据);
[卡发送:0xA4 p1:0x00 p2:0x00数据:数据le:@0
回复:^(NSData*回复数据,UInt16 sw,NSError*错误)
{
NSLog(@“响应:%@”,replyData);
如果(错误){
if(error.code==TKErrorCodeCommunicationError){
//设置响应错误代码。
}
NSLog(@“%@”,错误);
}
}];
}];

这是愚蠢的,但是在apdu中,如果没有成功代码
90 00
,则预期没有响应数据,
le
应该是
nil

[card sendIns:0xA4 p1:0x00 p2:0x00 data:nil le:nil
                reply:^(NSData *replyData, UInt16 sw, NSError *error)
         {
         }
状态字6D00为“指令代码不受支持或无效”

并非所有卡都允许选择主文件(0x3F00)。

Karim,您添加了一个新标记。如果您认为它对社区有价值,请添加“关于”信息。否则,您可以用一个有用的与密码学相关的标记替换这个问题上的标记,这可能会引起它应有的注意。