Click here to Skip to main content
15,887,422 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Oliver,
I'm checking the GemCard project for card reader OMNIKEY 3121.
After successful connecting the first APDU command (SELECT APPLICATION) returned with 0x6700 status.

I attempted to test it in two environments, with the same result.
I could not find the explanation of this error (invalid length?), probably can you help me?..

1. environment:
Windows XP, VS2003, .NET 1.1, 32 bit
2. environment:
Windows 7, VS2010, .NET 2.0 32 bit

Test code:
static APDUCommand apduSelectApp = new APDUCommand(0x00, 0xA4, 0x04, 0, null, 0);
    ...
    try
    {
        APDUResponse apduResp;
        CardNative iCard = new CardNative();

        // get driver name
        string[] readers = iCard.ListReaders();

        // Check existing of card reader
        if (readers == null || readers.Length == 0)
            throw new Exception("No smart card reader found!");

        // Connect to the card
        iCard.Connect(readers[0], SHARE.Shared, PROTOCOL.T0orT1);
        Console.WriteLine("Connects card on reader: " + readers[0]);

        // Select the single application
        byte[] ba = Utils.HexStringToByteArray("A0000000043060");
        APDUParam apduParam = new APDUParam();
        apduParam.Data = ba;
        apduParam.Le = 0x00; // or 0xFE, the same result...
        apduSelectApp.Update(apduParam);
        apduResp = iCard.Transmit(apduSelectApp);
        // here I get the error status...


The console output (debug):
Connects card on reader: OMNIKEY CardMan 3x21 0
APDU Buffer  : 00A4040007A0000000043060
APDU Response: 6700
Maestro (Debit) read, SW=6700


Note, that this card was successfully processed (select application, read record, etc.) by Smart Card Console (Java application).

Thank you in advance,

Serge
[DELETED]@hotmail.com

[edit]Never post your email address in any forum, unless you really like spam! If anyone replies to you, you will receive an email to let you know - OriginalGriff[/edit]
Posted
Updated 2-Dec-11 4:38am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900