Closed johnhenga closed 4 years ago
Hi, Please ignore my previous files. The following files should be more obvious. The newly attached files came from the same program. The signature element in "signedXML.xml.txt" could not be detected but the other one got reformmated then the website managed to detect the signature element. Sorry for the trouble.
.
So issue is resolved?
So issue is resolved? Not really, the signed XML passed several other validation tools. It's probably best to revisit this issue after new info acquired. Your team's contribution is truly admired.
DS Detected signedXML.xml.txt Hi, I am facing a curios scenario when I passed the attached file (named "DS Not detected signedXML.xml.txt") to this website ('https://validation.teda.th/webportal/#/validate), it could not detect the signature element in the file. However the website managed to detect signature element when another file generated by csdes4j with similar element(named " DS Detected signedXML.xml.txt") Here's the code I am using for generate "DS Not detect signedXML.xml.txt". Thank you for your help.
async function createEnvelopedSignature(keys, algorithm, signingXml, options) { const signedXml = new xadesjs.SignedXml(); const hash = !(options && options.hash) ? "SHA-256" : options.hash; const signingOptions = { references: [ { hash, transforms: ["enveloped"], uri: '' }, ], }; if (options) { if (options.certificate) { signingOptions.x509 = [options.certificate]; signingOptions.signingCertificate = options.certificate; signingOptions.id = options.id } if (options.policy) { signingOptions.policy = options.policy; } } const testSign1 = () => { var time = Date.now() const doc = fs.readFileSync("./ETDA-invoice.xml", { encoding: "utf8" }); const signingXml = xadesjs.Parse(doc);
}
DS Detected signedXML.xml.txt
DS Not detected signedXML.xml.txt