#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2011
    Posts
    3
    Rep Power
    0

    XML document signing


    Hi,

    Absolute newbie here.

    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:

    Code:
    <root>
        <creditcard>
            <number>19834209</number>
            <expiry>02/02/2002</expiry>
        </creditcard>
    </root>
    <Signature>
            WvZUJAJ/3QNqzQvwne2vvy7U5Pck8ZZ5UTa6pIwR7GE+PoGi6A1kyw==
    </Signature>
    Thanks in advance,
    Gil.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    May 2007
    Posts
    765
    Rep Power
    929
    OpenSSL is a common tool for generating keys and using them. It comes as both a stand-alone tool and a library you can call from C++. I've used it on both Windows and Linux systems. GnuPG is another common tool (and has libraries based on it). If you're on a Windows machine there's Microsoft's Crypto API. Many other tools like OpenSSH or the Java JDK also have key generation tools included.


    I'd strongly recommend that you hire/talk to someone with some experience in cryptography and discuss what you're trying to do. You cannot simply "add crypto" and make your protocol secure--you must understand what you're trying to ensure and what attacks you're trying to prevent. It is very easy to create a system (or an existing system incorrectly vulnerabilities) and expose vulnerabilities .
    sub{*{$::{$_}}{CODE}==$_[0]&& print for(%:: )}->(\&Meh);

IMN logo majestic logo threadwatch logo seochat tools logo