russellhaering / goxmldsig

Pure Go implementation of XML Digital Signatures
Apache License 2.0
154 stars 127 forks source link

Tweaked code for Cpix signature support #55

Open ap13istream opened 4 years ago

ap13istream commented 4 years ago

Changes:

trying to make it work for the CPIX xml document signature


<CPIX
    xmlns="urn:dashif:org:cpix">
<!-- Body of the Document -->
    <ds:Signature>
        <ds:SignedInfo>
            <ds:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/>
            <ds:SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha512"/>
            <ds:Reference URI="">
                <ds:Transforms>
                    <ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
                </ds:Transforms>
                <ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha512"/>
                <ds:DigestValue>YzsBBIZCWia4+DeVdFho6AgomXbsCIiQ0lovzl+u09/ccWF/
+EybgMDHUeecu6SqDqdfIEXVkoo1W+CQHnoLOQ==</ds:DigestValue>
            </ds:Reference>
        </ds:SignedInfo>
        <ds:SignatureValue>Rso3WHnj9bp9oXKdCWFNwtcjucdS9iR8x6xUlduAlhxxIpSeSZrxcnR8ZpDzLU
DuVnuFTPI6hGCD4qAnG8GgefhZIdMZ2SQWIhmaDVsRlfQjytC29HtRy4V/
Jp95XYigNHtlJFakh8kiWjDbTrXmAFBAAzMP5bn1LHEMY6QmIDQxUtTgWD8lO8lpgcjdJptST2WbUcAUx
+vXQPdhYebZSt91fOx99n+jt619HfMGd5H8NZDjdY+Eu3937MAxj4bKv+Lg+ZKz4FMz7bFj0bfyWkap9/
nbaFPW1wT1zQlA3oSz690jjKMcsYL32ZxLqpNQI2Nqmkek7jGaBLLW01yQOkvvvUNiJgVzoWkE7KgzRTy
vMtcTd9dlxLBsRPl6hxUSnFx55WgJaF6w8PBkrvqSv4kGhZ193H2rcSzcMcJAt3a1dTDFF7xd5fhMP1fJ
FZChVf3TsChQ0GMWPQrObajuvjpCljl/
p5FiSyJeLl6/2wvytoaNUtAiLv+DSxi7k8FOr24BuPBOeuRYnyV9WeA96mkfxhKVKzh3u9bwO9+UpZzb8
T2fJN8zwF6k34nfDbC8ccCdSPllLrHesKLTeL4xWvKZQMP2vWWOyJobFxL97dercnOVFEPN2tddzypyhR
47rUfHTY/b13gMjHX2b7ph6hV4uC/Rg1OaSAGB5kzURBA=</ds:SignatureValue>
        <ds:KeyInfo>
            <ds:X509Data>
                <ds:X509Certificate>... X509 certificate ... </ds:X509Certificate>
            </ds:X509Data>
        </ds:KeyInfo>
    </ds:Signature>
</CPIX>