I needed to generate XML on server but sign it in client using clients private key. But , for the sake of bandwidth consumption & some security issue, we do not want to send the whole xml from server to client for signing. We only want to send the hash/digest of the XML to the client. The sequence of events will look like this:
- server generates digest of XML and sends the digest to client
- client signs the digest/hash with client`s private key and sends it to server
- server merges the signed hash with the XML file to get the signed XML.
Previously , I have done similar decoupling for signing a pdf on server, using a client-side private key- I used itext library for that . But, finding it difficult for doing similar thing for XML signing using Oracles XML signing Library. The wellknown APIs available for signing xml does not seem to offer this function of signing an xml externally(decoupling the hash and signing part ) . So my question is, how can i externally sign a XML on server, using client`s privatekey ( sending only hash, instead of the full xml)?