-
Notifications
You must be signed in to change notification settings - Fork 189
Closed
Labels
Description
Is your feature request related to a problem? Please describe...
Hi, thank you so much for creating this amazing package. I am trying to make the signature element wrap the content that it is using to generate the signature. Is this possible with this package? I've tried a lot of things, but unfortunately none of the location options seems to support this use-case.
So basically what i'm trying to achieve is something like below:
<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<ds:SignedInfo>
<ds:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/>
<ds:SignatureMethod Algorithm="http://www.w3.org/2007/05/xmldsig-more#sha256-rsaMGF1"/>
<ds:Reference URI="#object">
<ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
<ds:DigestValue><!-- insert base64-encoded digest value --></ds:DigestValue>
</ds:Reference>
</ds:SignedInfo>
<ds:SignatureValue><!-- insert base64-encoded signature --></ds:SignatureValue>
<ds:KeyInfo>
<ds:X509Data>
<ds:X509SubjectName><!-- Insert subject name --></ds:X509SubjectName>
<ds:X509Certificate><!-- Insert base64-encoded certificate --></ds:X509Certificate>
</ds:X509Data>
</ds:KeyInfo>
<ds:Object Id="object">
<dip xmlns="http://itzbund.de/ozg/bzst/post/dip/v1/" version="1.0">
<header environment="TEST">
...
</header>
<body>
...
</body>
</dip>
</ds:Object>
</ds:Signature>
Describe the solution you'd like...
A mechanism to allow the signature to wrap the content.
Describe the alternatives you've considered...
Tried to move the signature after the xml is signed, but it causes the verification to fail.