Search code examples
xmlsec1

xmlsec1 | Is it possible to input the xml template as a string instead of pointing to a filename?


Normally I would do something like:

$ xmlsec1 --sign --privkey-pem MY_CERT_FILE.pem MY_TEMPLATE_FILE.xml

The above would spit out the signed xml string on the terminal screen.

I would like to do something like this though:

$ xmlsec1 --sign --privkey-pem MY_CERT_FILE.pem '<?xml version="1.0" encoding="UTF-8"?><Envelope><Data>Hello, World!</Data></Envelope>'

Obviously the above command does NOT work.

I am hoping for some sort of option flag before the xml input string which would allow me to accomplish just that.

I also asked this same question at the repo issue queue. Click here to see it.


Solution

  • The repo maintainer says this is not possible at the moment but accepts pull requests. Click here to see his answer and Click here to see the current workaround solutions.

    Unfortunately I do not possess the C programing skills necessary to pull off a patch.

    If any of you knows C programing and wish to contribute, please take this one for the nation, thank you.