Signing a text file using X509 certificate. RRS feed

  • Question

  • Hi,

    This question is about

    I need to sign a data from text file using private key from X509 certificate.

    I found couple of ways to do this. 

    With the first method, we can load the text file into a xml document and then use
    System.Security.Cryptography.XML.SignedXml to generate the signature.
    The signature data can be written to xml file and sent to the client.

    For verification, clients can again use System.Security.Cryptography.XML.SignedXml.

    With the second method we use System.Security.Cryptography.Pkcs.SignedCms class
    to both generate the signature and verify it.

    Which is the best one to use?

    Thanks for your help


    Wednesday, December 24, 2008 1:43 AM