2015-07-04 50 views
1

我想讀取使用CryptoTokenKit的OSX上的智能卡的主文件,但我總是得到statusword 6d00作爲響應。我也嘗試了一些修改來運行trivial example,但得到相同的錯誤。我的閱讀器是Gemalto PC Twin Reader。OSX CryptoTokenKit智能卡返回錯誤6d00

請讓我知道,如果你有任何建議來解決它。

我用下面的代碼:

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); 
      } 
     }]; 
    }]; 
+0

Karim,你添加了一個新標籤[tag:cryptotokenkit]。如果您認爲這對社區有價值,請爲其添加「關於」信息。否則,你可以用一個有用的與密碼相關的標籤來替換這個問題上的標籤,這可能會引起它應有的關注。 – Mogsdad

回答

1

這是愚蠢的,但在沒有響應數據沒有成功代碼90 00預期APDU,le應該nil

[card sendIns:0xA4 p1:0x00 p2:0x00 data:nil le:nil 
       reply:^(NSData *replyData, UInt16 sw, NSError *error) 
     { 
     }