Absolute newbie to cryptography.

I'm looking for C++ open source code (to be compiled on Windows, Mac, linux), for doing the following:

1. Generate private+public keys (need not run on all platforms).
2. (server side) Adding a digital signature to an XML document using a private key.
3. (client side) Verifying signature using the matching public key.

I envisage the signed XML to look like this:


Thanks in advance,