Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to sign XML document or verify XML document signature with C++?

Subj. I need to sign/verify under Windows in native C++ (no .NET), using private key for signing, public key for verification.

I saw few examples on MSDN (http://msdn.microsoft.com/en-us/library/ms761363(VS.85).aspx) that demonstrate how to sign the document with CSP (I don't know what this means).

For my case I need to use a "key" from the binary data array (using DSA encryption algorithm)... can somebody help me with that?

Thank you in advance.

like image 663
Budda Avatar asked May 14 '10 18:05

Budda


1 Answers

I recommand libxml2 and xmlsec which are perfect for this purpose.

The API can seem hard to read at first, but it works well. xmlsec uses OpenSSL to achieve the cryptographic part.

Providing a "short" example here is probably hard because the three libraries require some initialization and a lot of C calls.

like image 73
ereOn Avatar answered Oct 20 '22 00:10

ereOn