Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to create ds:Manifest in ds:Object? #138

Open
AleBonny95 opened this issue Dec 5, 2023 · 0 comments
Open

How to create ds:Manifest in ds:Object? #138

AleBonny95 opened this issue Dec 5, 2023 · 0 comments

Comments

@AleBonny95
Copy link

I'm having trouble generating an xml signature using xades that has the ds:manifest tag inside the ds:object tag.
(I'm trying to use both xmldsigjs and xadesjs.)
The signature I'd like to recreate should look like this:

<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
ds:SignedInfo
<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
<ds:SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"/>
<ds:Reference URI="#SW_Manifest-61e7-05edc1e9-eab45a08-e026592f-55e1">
ds:Transforms
<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
</ds:Transforms>
<ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
ds:DigestValue4racpft5VrGYIlZHp1ezUtRM2lxE5GdM7YIqWQa535o=</ds:DigestValue>
</ds:Reference>
<ds:Reference URI="#SW_KeyInfo-bd62-1c5b134b-78c62aa1-83ac401e-811c">
ds:Transforms
<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
</ds:Transforms>
<ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
ds:DigestValue5bBUjVeFC3utnRw7/KltvcvB1tZe/w+iLoh0dvyDzOo=</ds:DigestValue>
</ds:Reference>
</ds:SignedInfo>
ds:SignatureValue...stringValueSignature...</ds:SignatureValue>
<ds:KeyInfo Id="SW_KeyInfo-bd62-1c5b134b-78c62aa1-83ac401e-811c">
ds:X509Data
ds:X509Certificate...stringCertificate...</ds:X509Certificate>
</ds:X509Data>
</ds:KeyInfo>
ds:Object
<ds:Manifest Id="SW_Manifest-61e7-05edc1e9-eab45a08-e026592f-55e1">
<ds:Reference URI="">
ds:Transforms
<ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
</ds:Transforms>
<ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
ds:DigestValueXXXHu6s8R8+dgV3t7iQMJaedQr5mHvZBxPckCihgmZE=</ds:DigestValue>
</ds:Reference>
</ds:Manifest>
</ds:Object>
</ds:Signature>

But the signature I can create is this:

<ds:Signature Id="id-4b5fa12383e3" xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
ds:SignedInfo
<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
<ds:SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"/>
ds:Reference
ds:Transforms
<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
</ds:Transforms>
<ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
ds:DigestValuegY8hHehnP+1XkqSJpS434D57HBIY2swVhPl+6umSFQk=</ds:DigestValue>
</ds:Reference>
<ds:Reference URI="#xades-id-4b5fa12383e3" Type="http://uri.etsi.org/01903#SignedProperties">
<ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
ds:DigestValue06wFYvIXO9j4BftKmnr9CkV1MeuLCAxND9U2X766QD0=</ds:DigestValue>
</ds:Reference>
</ds:SignedInfo>
ds:SignatureValue...stringValueSignature...</ds:SignatureValue>
ds:KeyInfo
ds:X509Data
ds:X509Certificate...stringCertificate...</ds:X509Certificate>
</ds:X509Data>
</ds:KeyInfo>
ds:Object
<xades:QualifyingProperties Target="#id-4b5fa12383e3" xmlns:xades="http://uri.etsi.org/01903/v1.3.2#">
<xades:SignedProperties Id="xades-id-4b5fa12383e3">
xades:SignedSignatureProperties
xades:SigningTime2023-12-05T15:57:21.161Z</xades:SigningTime>
xades:SigningCertificate
xades:Cert
xades:CertDigest
<ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
ds:DigestValue8bzdEXsVVBc4E6Qhg8VNuX46fhCdCvqY9LzTJnVKA1E=</ds:DigestValue>
</xades:CertDigest>
xades:IssuerSerial
ds:X509IssuerNameC=NL, O=QuoVadis Trustlink B.V., OU=Issuing Certification Authority, CN=QuoVadis EU Issuing Certification Authority G2</ds:X509IssuerName>
ds:X509SerialNumber694395474722160626358886281620874695673047986886</ds:X509SerialNumber>
</xades:IssuerSerial>
</xades:Cert>
</xades:SigningCertificate>
</xades:SignedSignatureProperties>
</xades:SignedProperties>
</xades:QualifyingProperties>
</ds:Object>
</ds:Signature>

Can you help me create the first signature example?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant