I'm trying to read the master file of a smartcard on OSX using CryptoTokenKit but I always get statusword 6d00
as response. I also tried to run the trivial example with some modifications but get the same error. My reader is Gemalto PC Twin Reader.
Please let me know if you have any suggestion to fix it.
I'm using the following code:
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);
}
}];
}];