Click here to Skip to main content
15,891,597 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i hava starkey400 usb etoken.i import my certificate into this token. how i sign a document using this token certificate using c#.net
Posted
Updated 28-Nov-17 18:12pm

1 solution

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();
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900