我想在C#中为智能卡PIN对话框创建自己的对话框 [英] I want to create my own dialog box for smart card PIN dialog in C#

查看:73
本文介绍了我想在C#中为智能卡PIN对话框创建自己的对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


推荐答案

您好,

您发布的代码将无法使用,因为您在调用 CryptSetProvParam .
首先,您需要使用提供者名称和用于签名的容器名称来调用 CryptAcquireContext .这将为您提供HCRYPTPROV,您可以在呼叫 CryptSetProvParam 时使用 PP_SIGNATURE_PIN PP_KEYEXCHANGE_PIN 来验证卡的PIN.可以使用您自己的对话框从用户中检索此PIN.
之后,您可以调用 CryptSignHash CryptSignMessageWithKey 以便计算签名和PIN弹出窗口将不会显示.

希望对您有所帮助.

干杯,
-
Mounir IDRASSI
IDRIX
http://www.idrix.fr

Hi,

The code you posted will not work because you are using a dummy HCRYPTPROV in the call to CryptSetProvParam .
First, you need to call CryptAcquireContext with the provider name and the container name your using for the signature. This will give you a HCRYPTPROV that you will use in the call to CryptSetProvParam with PP_SIGNATURE_PIN or PP_KEYEXCHANGE_PIN in order to verify the PIN of the card. This PIN can be retrieved from the user using your own dialog box.
Afterwards, you can call CryptSignHash or CryptSignMessageWithKey in order to compute the signature and the PIN popup will not be displayed.

I hope this will help.

Cheers,
--
Mounir IDRASSI
IDRIX
http://www.idrix.fr


这篇关于我想在C#中为智能卡PIN对话框创建自己的对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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