How to write files on smart cards in C#

11,541

Solution 1

First, you need to create a managed wrapper for WinScard dll. WinScard is Microsoft's implementation of PC/SC. You will need this dll to send and receive APDUs from the card.

Next, you need to know what is the OS of the smart card you are going to use. You must have the API documentation of the smart card. This will help you construct the correct APDUs for writing a file. In the smart card world, there is no single, generic way to create a file. It all depends on the card's OS.

Solution 2

Subsembly is what we use. We don't do much with it, but it should get you started.

http://www.smartcard-api.com/

Solution 3

Here is an article in CodeProject call "A Smart Card Framework" that can help you.

Solution 4

pcsc-sharp mentioned at your link above is not really actively maintained. However, I have had great success with Daniel Müller's library with the same name (pcsc-sharp)

The docs here are quite good, and the library itself has worked for me very well on both 32bit and 64bit windows and linux.

Share:
11,541
Piotr Czapla
Author by

Piotr Czapla

Updated on June 14, 2022

Comments

  • Piotr Czapla
    Piotr Czapla about 2 years

    I'd like to write to file in a processor smart card that accepts APDU commands. Do you know any examples in C# or smartcard sdk?

    Has anyone used http://code.google.com/p/pcsc-sharp/?

  • yanong_banikanhon
    yanong_banikanhon almost 15 years
    I have not actually used pcsc-sharp. In my previous commercial application, I have created the pc/sc wrapper myself. pcsc-sharp is under 2-clause BSD license and there are some provisions in the clause that my client doesn't like.