Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2801
  • Last Modified:

How do i read the ATR & the serial number in it from a HID Proximity Card using PC/SC winscard.dll APIs

I am trying to read the Serial Number of a HID proximity card using the 'winscard.dll' APIs.
I have obtained c# wrapper code which is capable of performing

- GetAllReaders
Wraps the PCSC function
             LONG SCardListReaders(SCARDCONTEXT hContext,
                        LPCTSTR mszGroups,
                        LPTSTR mszReaders,
                        LPDWORD pcchReaders
            );


- Connect to a active reader
Wraps the PCSC function
              LONG SCardConnect(
                        IN SCARDCONTEXT hContext,
                        IN LPCTSTR szReader,
                        IN DWORD dwShareMode,
                        IN DWORD dwPreferredProtocols,
                        OUT LPSCARDHANDLE phCard,
                        OUT LPDWORD pdwActiveProtocol
                  );

- Send APDU commands to the reader and process the response
Wraps the PCSC function
             LONG SCardTransmit(
                  SCARDHANDLE hCard,
                        LPCSCARD_I0_REQUEST pioSendPci,
                        LPCBYTE pbSendBuffer,
                        DWORD cbSendLength,
                        LPSCARD_IO_REQUEST pioRecvPci,
                        LPBYTE pbRecvBuffer,
                        LPDWORD pcbRecvLength
                  );

I am interested in knowing:
1) How to get the ATR
2) how to obtain the UNIQUE SERIAL NUMBER of the smart card
0
bhaskarvasudevan
Asked:
bhaskarvasudevan
1 Solution
 
bhaskarvasudevanAuthor Commented:
Found the solution by adopting the approach provided in the article
http://www.codeproject.com/KB/smart/smartcardapi.aspx
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now