Skip to content
This repository was archived by the owner on Aug 12, 2025. It is now read-only.
This repository was archived by the owner on Aug 12, 2025. It is now read-only.

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

@AleBonny95

Description

@AleBonny95

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions