-
Notifications
You must be signed in to change notification settings - Fork 188
Open
Labels
Description
Issue Description
v6.0.1 is OK, but in v6.1.0 I am getting DeprecationWarning when computeSignature() is called.
Code Snippet
private signXml(xml: string) {
const sig = new SignedXml({
privateKey: ERP_PRIV_KEY,
getKeyInfoContent: () => {
const certContent = ERP_CERT.toString()
.match(/-----BEGIN CERTIFICATE-----([\s\S]*?)-----END CERTIFICATE-----/)?.
?.replace(/\n/g, '') || '';
return `<X509Data><X509Certificate>${certContent}</X509Certificate></X509Data>`;
},
signatureAlgorithm: 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha256',
canonicalizationAlgorithm: 'http://www.w3.org/2001/10/xml-exc-c14n#',
});
sig.addReference({
xpath: "//*[local-name()='ZalozeniPredpisuDotaz']",
transforms: ['http://www.w3.org/2001/10/xml-exc-c14n#'],
digestAlgorithm: 'http://www.w3.org/2001/04/xmlenc#sha256',
uri: '',
isEmptyUri: true,
});
sig.computeSignature(xml, {
location: {
reference: "//*[local-name()='ZalozeniPredpisuDotaz']",
action: 'append',
},
});
return sig.getSignedXml();
}
Additional Context
- Library version: [email protected]
- Error messages:
(node:720) DeprecationWarning: getReferences() is deprecated. Use `.getSignedReferences()` instead.
(Use `node --trace-deprecation ...` to show where the warning was created)