I am trying to sign a document via CryptoTech SCR3310 using A Smart Card Framework for .NET. I use demo from second article (SmartcardFmwk). While sending APDUCommand I will get errors like:
- for verifing (new APDUCommand(0x00, 0x20, 0, 1, null, 0)) SW1= 69 SW2=83 (Authentication method blocked) ErrorNr1
- for selecting file (new APDUCommand(0x00, 0xA4, 0, 0, null, 0)) [SW=61 SW2=2E][4] ErrorNr2
- for getting response (new APDUCommand(0x00, 0xC0, 0, 0, null, 0)) SW=68 00 ErrorNr3
CODE:
APDUCommand apduVerifyCHV = new APDUCommand(0x00, 0x20, 0, 1, null, 0)
APDUCommand apduSelectFile = new APDUCommand(0x00, 0xA4, 0, 0, null, 0)
APDUResponse apduResp;
CardNative iCard = new CardNative();
iCard.Connect(readers[0], SHARE.Shared, PROTOCOL.T0orT1); //connected
Console.WriteLine("Connects card on reader: " + readers[0]);
// Verify the PIN (PIN = 12341234)
byte[] pin = new byte[] { 0x31, 0x32, 0x33, 0x34, 0x31, 0x32, 0x33, 0x34 };
APDUParam apduParam = new APDUParam();
apduParam.Data = pin;
apduVerifyCHV.Update(apduParam);
apduResp = iCard.Transmit(apduVerifyCHV); //ErrorNr1
// Select the MF (3F00)
apduParam.Data = new byte[] { 0x3F, 0x00 };
apduSelectFile = new APDUCommand(0x00, 0xA4, 0, 0, apduParam.Data, 0);
apduSelectFile.Update(apduParam);
apduResp = iCard.Transmit(apduSelectFile); //ErrorNr2
apduGetResponse.Update(apduParam);
apduResp = iCard.Transmit(apduGetResponse); //ErrorNr3
What shall I do to get rid of those errors?? I tested the card with another programs and there are no errors.
May be the APDUCommand parameters are wrong. How do you think?