Donald N. Mafa
Donald N. Mafa

Reputation: 5283

How to sign an xml document with a certificate and what type of solutions are required?

We have developed a web application that generates an xml file. To deploy the application to production, we have purchased an SSL certificate through DigiCert, so that it runs under HTTPS protocol, however, one of the requirements are to send the xml file with a signature to be verified by the receiver (client), that it is in fact a genuine xml document sent from our service.

Do we need to get a document/code signing certificate too to achieve this, or is the SSL certificate we have purchased sufficient and to just follow this Microsoft tutorial:

https://learn.microsoft.com/en-us/dotnet/standard/security/how-to-encrypt-xml-elements-with-x-509-certificates

Upvotes: 0

Views: 2730

Answers (1)

Cleptus
Cleptus

Reputation: 3531

The X509 XML signing code can work with any X509 certificate. From the coding perspective you can use the one you already have unless your client demands you to use a cert generated from a specific CA.

The code you linked does encrypt an XML, but you stated you did need to sign it. They are different things.

Encrypting does make it unreadable to anyone that does not have the private key.

Signing does a signature of the content and adds it at the end of it, so anyone can check the content was not altered.

Upvotes: 1

Related Questions