如何用C#在智能卡上写入文件
我想写入接受 APDU 命令的处理器智能卡中的文件。 您知道 C# 或智能卡 sdk 中的任何示例吗?
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/?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
首先,您需要为 WinScard dll 创建一个托管包装器。 WinScard 是 Microsoft 对 PC/SC 的实现。 您将需要此 dll 来从卡发送和接收 APDU。
接下来,您需要知道您要使用的智能卡的操作系统是什么。 您必须有智能卡的API文档。 这将帮助您构建正确的 APDU 来写入文件。 在智能卡领域,没有单一通用的方法来创建文件。 这一切都取决于卡的操作系统。
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.
这是 CodeProject 中的一篇文章,名为“智能卡框架”,可以提供帮助你。
Here is an article in CodeProject call "A Smart Card Framework" that can help you.
我们使用的是 Subsembly。 我们对此没有做太多的事情,但它应该可以帮助您入门。
http://www.smartcard-api.com/
Subsembly is what we use. We don't do much with it, but it should get you started.
http://www.smartcard-api.com/
我用 C# 开发了 Winscard 的托管包装器,用于发送 APDU 并从基于处理器的智能卡接收响应。
如果您没有卡操作系统的 API,但您知道它遵循 ISO 7816,那么您可以使用该标准来构建 APDU。
如果您需要有关该主题的更多帮助,请告诉我。 我从事智能卡工作已经四年了。
I have developed my Managed Wrappers of Winscard in C# for sending APDUs and receiving Response from processor based smart cards.
If you don't have the API for the card's OS but you know that it follows ISO 7816 then you can use that standard to construct the APDU.
Let me know if u require more help on the topic. I have been working 4 years now on Smart Cards.
上面链接中提到的 pcsc-sharp 并未真正得到积极维护。 然而,我在 Daniel Müller 的同名库(pcsc-sharp )
这里的文档非常好,并且该库本身对我来说非常有用在 32 位和 64 位 Windows 和 Linux 上都可以正常运行。
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.