= xmlsec =
 * https://www.aleksey.com/xmlsec/index.html

XML Security Library is a C library based on LibXML2. The library supports major XML security standards: 
 * https://users.dcc.uchile.cl/~pcamacho/tutorial/web/xmlsec/xmlsec.html

== Slackbuild ==
{{{#!highlight bash
wget https://slackbuilds.org/slackbuilds/14.2/libraries/xmlsec.tar.gz
tar xvzf xmlsec.tar.gz 
cd xmlsec
wget https://www.aleksey.com/xmlsec/download/xmlsec1-1.2.29.tar.gz
./xmlsec.SlackBuild 
installpkg  /tmp/xmlsec-1.2.29-i586-1_SBo.tgz
}}}


== Sign with certificate test.xml ==
 * openssl req -new -x509 -days 3650 -nodes -out cert.pem -keyout privkey.pem
 * xmlsec1 --sign --privkey-pem privkey.pem  --output test_signed.xml test.xml 
 * xmlsec1 --verify test_signed.xml 

=== test.xml ===
{{{#!highlight xml
<a>
        <b Id="tosign">
                <c>test</c>
        </b>
<!-- signature template -->
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
  <SignedInfo>
   <CanonicalizationMethod Algorithm=
    "http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/>
   <SignatureMethod Algorithm=
    "http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
   <Reference URI="">
    <Transforms>
     <Transform Algorithm=
      "http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
    </Transforms>
    <DigestMethod Algorithm=
      "http://www.w3.org/2000/09/xmldsig#sha1"/>
    <DigestValue></DigestValue>
   </Reference>
  </SignedInfo>
  <SignatureValue />
  <KeyInfo>
   <X509Data >
    <X509SubjectName/>
    <X509IssuerSerial/>
    <X509Certificate/>
   </X509Data>
   <KeyValue />
  </KeyInfo>
 </Signature>
</a>
}}}