PeculiarVentures/xadesjs

How I can Ignore SignaturePolicyIdentifier on the XML output

rmendoza83 opened this issue · 3 comments

That's say in the title, I want to know how i can ignore the part of SignaturePolicyIdentifier tag, for example i am calling the sign in this way:

signedXml.Sign(  // Signing document
          algorithm,          // algorithm
          keys.privateKey,    // key
          xmlDoc,             // document
          {                   // options
            keyValue: keys.publicKey,
            policy: null,
            signingCertificate: keys.x509
          })
      })

but the final XML output includes the following:

<xades:SignaturePolicyIdentifier>
    <xades:SignaturePolicyImplied/>
</xades:SignaturePolicyIdentifier>

That part i want to doesn't generate in the final XML output, It's can be done?

@rmendoza83 Looks like xadesjs should be updated. It's not possible in current version

https://github.com/PeculiarVentures/xadesjs/blob/master/src/signed_xml.ts#L152

@rmendoza83 I published new xadesjs version v2.0.14.
It doesn't add <SignaturePolicyIdentifier> if policy option is null, undefined or false

@microshine thanks! its works now