使用第 3 方 CSP 从 cryptoApi 或 CAPICOM 访问特定 ADPU 功能
过去两个月我一直在尝试,但没有成功,我想是时候在这里问了。
我有一张智能卡,并从我的客户处获得了CSP。 我有描述我可以(并且知道如何)运行的 APDU 命令的文档。
我需要将小文件(数据)保存到卡上,例如姓名、地址、照片等。 然后保存证书。
在文档中,我读到您必须进行外部身份验证才能稍后使用安全消息传递来访问卡上的文件。 我在相互身份验证算法中的某个地方出现错误(需要计算 MAC、DES、TRIPPLE DES 等,我已经尝试了数周才能使其正常工作...) 我知道如何执行卡上的所有操作,除了需要相互验证的功能之外。
我查看了 CSP 提供的功能,但没有看到任何外部身份验证。我唯一看到非 APDU 级外部身份验证的地方是在“Windows 智能卡微型驱动程序规范”中,我看到如下功能:CardAuthenticateEx。 但我不知道如何调用它们(它们在哪个 dll 中)。 这些功能应该在 CSP 中吗?
当我拥有 CSP 时,使用 APDU 命令进入低级别是错误的方法吗? 我应该使用 CryptoAPI 或 CAPICOM 吗?如果是这样,那么如果没有(或我找不到)可以写入文件的函数,我如何进行外部身份验证和使用文件。 (同样,所有这些功能都在“Windows 智能卡微型驱动程序规范”中。
I have tried for the last 2 months without success and I think it's time I ask here.
I have a smart card and got a CSP from my client.
I have documents that describe APDU commands that I can (and know how to) run.
I need to save small files (data) to the card like name, address, photo etc.
And later on save certificates.
In the documentation I read that you have to do do external authentication to later use secure messaging to access the files on the card.
I have an error somewhere in the mutual authentication algorithm (requires calculating a MAC, DES, TRIPPLE DES etc and i have tried for weeks to get it working...)
I know how to do everything on the card except for functions that require mutual authentication.
I looked at the functions provided by the CSP and don't see any external authentication there. The only place i saw non APDU level external auth was in "Windows Smart Card Minidriver Specification" where i see functions like: CardAuthenticateEx.
But i dont know how to call them (which dll they are in).
Should these functions be in the CSP?
Is it a wrong approach to go low level with APDU commands when i have the CSP.
Should I instead use CryptoAPI or CAPICOM? If so then how can i external authenticate and use files if there are no (or i can't find) functions that would write to a file. (again all these functions are in the "Windows Smart Card Minidriver Specification".
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
许多智能卡遵循全局平台规范,该规范(取决于卡上安装的小程序及其配置方式)可能需要在与卡通信之前进行安全握手。
如果您需要将文件写入卡,则不会使用 CSP。 CSP 通过将某些加密调用重新路由到卡的处理器来支持操作系统级加密交互。要写入卡上的文件,您需要将 APDU 发送到执行以下功能的卡:
使用 AID(小程序 ID)
我公司为 IE 和 Firefox 浏览器制作了一个插件,可以帮助实现此目的,它包括全球平台的握手功能,并且我们在上面有一个“沙箱”形式我们的网站可让您测试卡交互脚本。
请访问 https://cardboss.cometway.com 了解更多信息。
Many smartcards follow the Global Platform specification, which (depending on the installed applets on the card and how they are configured) may require a security handshake before communicating with the card.
If you need to write files to the card, you will NOT be using the CSP. The CSP supports OS level cryptographic interactions by re-routing certain crypto calls to the card's processor. To write to a file on the card, you'll be sending APDUs to the card that perform the following functions:
using the AID (applet ID)
My company makes a plugin for IE and Firefox browsers that helps with this, it includes handshake functions for global platform, and we have a "sandbox" form on our site that lets you test your scripts for card interactions.
Check out https://cardboss.cometway.com for more information.