访问证书和私钥从pkcs#11令牌或智能卡 [英] Access certificate and private key from pkcs#11 token or smart-card

查看:406
本文介绍了访问证书和私钥从pkcs#11令牌或智能卡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在C#4中创建一个应用程序,该应用程序必须签署一个XML文件。我没有什么大问题,直到我碰到这个:访问智能卡/令牌获得其证书和私钥。

没有什么真的开箱,只是获得证书和密钥,基于在密码中。

I am making an application, in C#4, that has to sign a XML file. I'd no great problems, until I bumped into this: accessing a smart-card/token to get its certificates and private keys.
Nothing really out of the box, just get the certificate and key, based in a password.

有人知道如何在没有任何付费框架的情况下如何做?

Does anyone know how to do it without any paid framework?

推荐答案

p> Microsoft Crypto API支持开箱即用的与硬件设备交互的能力。这将要求您的卡有制造商提供的驱动程序。根据驱动程序可能已经为您下载的卡和操作系统。下面的.NET文章应该帮助你至少开始,看看是否可以使用一些MSoft API的开箱即用。 http://msdn.microsoft.com/en-us/library/ms229931.aspx

The Microsoft Crypto API's support the ability to interact with hardware devices out of the box. This will require that your card have a driver provided by the manufacture though. Depending on the card and OS the driver may have already downloaded for you. The following .NET article should help you at least get started and see if you can use some of the MSoft API's out of the box. http://msdn.microsoft.com/en-us/library/ms229931.aspx.

如果您有关于正在使用的卡类型的其他信息,您可以使用PC / SC和特定的APDU命令来询问卡为您签名或加密信息。由于安全原因,卡片小程序不允许检索证书私钥是很常见的。

If you have additional information about the type of card you are utilizing you may be able to use PC/SC and specific APDU commands to ask the card to sign or encrypt information for you. It is common for card applets to not permit retrieval of a certificates private key for security reasons.

祝你好运。如果您对此还有其他问题,请添加评论。

Good Luck. Add a comment if you have some more questions about this.

这篇关于访问证书和私钥从pkcs#11令牌或智能卡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆