如何用Java与智能卡交互?
Java 中是否有一个可以与智能卡交互的库(API)?类似于 WinSCard 库。
我需要能够连接智能卡并从中读取数据。我需要用 Java 实现它,以便我可以在任何操作系统(Linux、Mac、Windows)下使用它。由于 WinSCard 库仅在 Windows 下工作,因为它使用 DLL (WinSCard.dll)。
Java 中有像 WinSCard 一样好的东西吗?
Is there is a library (API) in Java with which I can interact with a smart card? Similar to the WinSCard library.
I need to be able to connect with the smart card and read data from it. I need to implement it in Java so that I can use it under any OS (Linux, Mac, Windows). Since, the WinSCard library only works under Windows because it uses a DLL (WinSCard.dll).
Is there anything as good as WinSCard in Java?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
解决方案之一是使用 Java™ 智能卡 I/O API。请参阅 “描述” 部分的简单使用示例。
One of the solutions is to use Java™ Smart Card I/O API. See the "Description" section for a simple usage example.
基本 API 是 智能卡IO,提供向卡发送APDU 的基本操作。在此之后,还有几个更高的API可用。例如,如果您需要连接到 JavaCard 来管理小程序,则需要一个 Global Platform 实现,例如 Opal 库(无耻的自我推销)。
The basic API is the Smartcard IO, which offer basic operation to send APDU to the card. After this, there is several higher API available. For instance, if you need to connect to a JavaCard to manage applet, you need a Global Platform implementation, for instance the Opal Library (Shameless Self-promotion).
PC/SC规范作为读卡器和卡与计算机之间的标准接口。打开VC支持PC/SC标准的密钥头文件WinScard.h。
用java可以调用VC的PC/SC。作为解决你问题的中间方式。
PC/SC specification as a reader and a satandard interface between card and computer.Open the VC support PC/SC standard key header file WinScard.h.
With java can call the PC/SC of VC.As a middle way to solve you problems.