views:

232

answers:

3

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.

+2  A: 

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.

ereOn
ereOn, as far as I see xmlsSec doesn't support DSA, right? I am need it to work with my keys (private for signing/encoding, public for verification). Any other thoughts?Thanks.
Budda
I admit that I never had to deal with DSA. I know OpenSSL handles DSA just fine and that xmlsec relies on OpenSSL. Maybe there is a way to add a "DSA" handler to xmlsec code ? You should ask the authors on their mailing-list.
ereOn
Searching for this same thing got to this answer. Just downloaded binaries for Windows, I'll take a look tonight. Seems promising (there are Delphi bindings provided which is way cool!)
Leonardo Herrera
+1  A: 

Google's keyczar lib is also very easy to use

Martin Beckett
Forget to say, that I need that library to be workable under Windows. But current version (0.6b) has limitations. One of them: - Does not work on Windows (should be relatively easy to port it using OpenSSL however it would require much more work to use MS CAPI instead).
Budda
@Budda: I added the "windows" tag to make that obvious.
ereOn
A: 

There's also Crypto++

Wacek