views:

17

answers:

1

Hi, I´m trying to sign some text or XML node using my certificates, installed on Internet Explorer or from filesystem (or some method!)...but I want to ask the user for his certificate password when signing.

If i´m not wrong, I think that I need that password to access the private key and with that key, sign my data....is ok?

Nothing that I read helps me in the part of asking the password or getting the private key.

Some examples or help will be great.

A: 

With X509Certificate2 x509 = new X509Certificate2(@"c:\Test.pfx", "test") you can import certificate with the private key information from the PFX file. The private key can be received by x509.PrivateKey.

You can find many examples how to sign XML file. For example http://developers.de/blogs/rolf_nebhuth/archive/2009/05/13/signing-xml-documents.aspx or http://www.west-wind.com/weblog/posts/257599.aspx.

Oleg