In C#, sign an xml with a x.509 certificate and check the signature

前端 未结 3 940
日久生厌
日久生厌 2020-12-04 17:19

I\'m trying to sign an XML file using a x.509 certificate, I can use the private key to sign the document and then use the CheckSignature method (it has an overload that rec

3条回答
  •  有刺的猬
    2020-12-04 17:50

    First off all you need to be sure that the certificate .pfx or .cer that you are using is intended for signing purpose.

    You can check same in General Tab of a certificate
    
    *.Proves your identity to a remote computer
    *.Protects e-mail messages
    *.Allows data to be signed with the current time
    *.Allows data on disk to be encrypted
    *.2.16.356.100.2
    **Document Signing**
    

    A Complete console application to digitally sign/verify XmlDocument in C# is written here.

提交回复
热议问题