You are not logged in.

#1 2013-05-29 14:25:57

Archdove
Member
Registered: 2011-09-23
Posts: 118

xml-security-c - Signing and Validating XML

Hello

I have to embed xml verifying capabilities into a c++ program. I failed so far.

xml-security-c provides a few tools which are supposed to be "easy" to use, but as far as i'm concerned, they are not.

what i do:
1. Creating an rsa key pair with openssl:

openssl genrsa -out key.pem 2088
openssl rsa -in key.pem -pubout > key.pub

2. Add modulus and exponent: (by hand from this output)

openssl rsa -modulus -pubin <key.pub
openssl rsa -pubin -inform PEM -text -noout <key.pub

3. Signig my example:

Templatesign -r key.pem  pass123 test.lic > signed.lic

4. Check for changes:

Digest and SignedValue differ!
Exponent and modulus not - as expected

5. Check signature:

checksig signed.lic || echo $?
Signature failed verification
Validation of <SignedInfo> failed
[1]+  Exit 1                  checksig signed.lic
1

Signing works, Validating not and thus signing does not work either because if it would, i could validate it.

Does anyone use this tool? Have some Experience? I would appreciate any help an especially a solid example.
When i got it to work in the shell with these tools i can easy create a C++ class for my personal use.


Regard, Archdove

Offline

Board footer

Powered by FluxBB