PKCS11Interop - sign XML documents using PKCS11Interop

53 views
Skip to first unread message

dimita...@gmail.com

unread,
Oct 28, 2019, 9:06:45 AM10/28/19
to Pkcs11Interop
Hello,

I have a batch of XML documents that I want to iterate over and digtally sign them using my Smard Card Reader. 

I have done everything except .. the signing part. 

It is a Gellato smart card.

I have been browsing through the documentation and the projects and I am struggling to understand how all this works.

How do I ask the user to have PIN code box to enter when signing the documents? I have added the .dll by hard coding it. 

It reads the reader successfully. However, I do not know what are the next steps:

How do I get the private key if it is sealed inside the smart card?  

What do I need to generate for all this to take place?

The certificate is also in the smart card but I can export it.
 

Please help.

arsu...@gmail.com

unread,
Jul 6, 2020, 12:43:20 PM7/6/20
to Pkcs11Interop
Hi,

If you take a look at the code.
private static RSACryptoServiceProvider GetEtokenProvider(string password)
Is a solution to do it through the .Net crypto API, if you would call the same function content but without the password, that means without setting the `KeyPassword` param, the underliing software would prompt the user for the password.
Then you would be able to use the `RSACryptoServiceProvider` object to sign and verify data.
Reply all
Reply to author
Forward
0 new messages