使用c#.net代码的数字签名 [英] digital signature using c#.net code

查看:159
本文介绍了使用c#.net代码的数字签名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我hava starkey400 usb etoken.i将我的证书导入此令牌。如何使用c#.net

i hava starkey400 usb etoken.i import my certificate into this token. how i sign a document using this token certificate using c#.net

推荐答案

使用此令牌证书签署文档亲爱的Rajesh

当您在计算机上连接令牌时,驱动程序实用程序本身将证书导出到Windows证书库。因此,您可以使用X509Store命名空间访问证书。请仔细阅读下面的示例代码。









X509Store my = new X509Store(StoreName.My,StoreLocation.CurrentUser);

my.Open(OpenFlags.ReadOnly);

RSACryptoServiceProvider csp = null;



foreach(my.Certificates中的X509Certificate2证书)

{

X509Certificate2 certificate = new X509Certificate2(cert);

txtRemarks.Text = certificate.GetExpirationDateString();

txtRemarks.Text = txtRemarks.Text +''+ certificate.GetIssuerName()。ToString();

}
Dear Rajesh
when you connect your token on your computer, the driver utility itself export your certificate to windows certificate store. So you can access the certificate using X509Store namespace. please go through the sample code below.




X509Store my = new X509Store(StoreName.My, StoreLocation.CurrentUser);
my.Open(OpenFlags.ReadOnly);
RSACryptoServiceProvider csp = null;

foreach (X509Certificate2 cert in my.Certificates)
{
X509Certificate2 certificate = new X509Certificate2(cert);
txtRemarks.Text = certificate.GetExpirationDateString();
txtRemarks.Text =txtRemarks.Text + ' ' + certificate.GetIssuerName().ToString();
}


使用下面的链接可能是有用的。

https://www.signfiles.com/signature-library/
Use below link may be its useful.
https://www.signfiles.com/signature-library/


这篇关于使用c#.net代码的数字签名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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