Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

xml-crypto

node-saml5.9mMIT6.1.2TypeScript support: included

Xml digital signature and encryption library for Node.js

xml, digital signature, xml encryption, x.509 certificate

readme

xml-crypto

Build Gitpod Ready-to-Code


Upgrading

The .getReferences() AND the .references APIs are deprecated. Please do not attempt to access them. The content in them should be treated as unsigned.

Instead, we strongly encourage users to migrate to the .getSignedReferences() API. See the Verifying XML document section We understand that this may take a lot of efforts to migrate, feel free to ask for help. This will help prevent future XML signature wrapping attacks.


Install

Install with npm:

npm install xml-crypto

A pre requisite it to have openssl installed and its /bin to be on the system path. I used version 1.0.1c but it should work on older versions too.

Supported Algorithms

Canonicalization and Transformation Algorithms

Hashing Algorithms

Signature Algorithms

HMAC-SHA1 is also available but it is disabled by default

to enable HMAC-SHA1, call enableHMAC() on your instance of SignedXml.

This will enable HMAC and disable digital signature algorithms. Due to key confusion issues, it is risky to have both HMAC-based and public key digital signature algorithms enabled at same time.

You are able to extend xml-crypto with custom algorithms.

Signing Xml documents

When signing a xml document you can pass the following options to the SignedXml constructor to customize the signature process:

  • privateKey - [required] a Buffer or pem encoded String containing your private key
  • publicCert - [optional] a Buffer or pem encoded String containing your public key
  • signatureAlgorithm - [required] one of the supported signature algorithms. Ex: sign.signatureAlgorithm = "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"
  • canonicalizationAlgorithm - [required] one of the supported canonicalization algorithms. Ex: sign.canonicalizationAlgorithm = "http://www.w3.org/2001/10/xml-exc-c14n#WithComments"

Use this code:

var SignedXml = require("xml-crypto").SignedXml,
  fs = require("fs");

var xml = "<library>" + "<book>" + "<name>Harry Potter</name>" + "</book>" + "</library>";

var sig = new SignedXml({ privateKey: fs.readFileSync("client.pem") });
sig.addReference({
  xpath: "//*[local-name(.)='book']",
  digestAlgorithm: "http://www.w3.org/2000/09/xmldsig#sha1",
  transforms: ["http://www.w3.org/2001/10/xml-exc-c14n#"],
});
sig.canonicalizationAlgorithm = "http://www.w3.org/2001/10/xml-exc-c14n#";
sig.signatureAlgorithm = "http://www.w3.org/2000/09/xmldsig#rsa-sha1";
sig.computeSignature(xml);
fs.writeFileSync("signed.xml", sig.getSignedXml());

The result will be:

<library>
  <book Id="_0">
    <name>Harry Potter</name>
  </book>
  <Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
    <SignedInfo>
      <CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
      <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
      <Reference URI="#_0">
        <Transforms>
          <Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
        </Transforms>
        <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
        <DigestValue>cdiS43aFDQMnb3X8yaIUej3+z9Q=</DigestValue>
      </Reference>
    </SignedInfo>
    <SignatureValue>vhWzpQyIYuncHUZV9W...[long base64 removed]...</SignatureValue>
  </Signature>
</library>

Note:

If you set the publicCert and the getKeyInfoContent properties, a <KeyInfo></KeyInfo> element with the public certificate will be generated in the signature:

<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
  <SignedInfo>
    ...[signature info removed]...
  </SignedInfo>
  <SignatureValue>vhWzpQyIYuncHUZV9W...[long base64 removed]...</SignatureValue>
  <KeyInfo>
    <X509Data>
      <X509Certificate>MIIGYjCCBJagACCBN...[long base64 removed]...</X509Certificate>
    </X509Data>
  </KeyInfo>
</Signature>

For getKeyInfoContent, a default implementation SignedXml.getKeyInfoContent is available.

To customize this see customizing algorithms for an example.

Verifying Xml documents

When verifying a xml document you can pass the following options to the SignedXml constructor to customize the verify process:

  • publicCert - [optional] your certificate as a string, a string of multiple certs in PEM format, or a Buffer
  • privateKey - [optional] your private key as a string or a Buffer - used for verifying symmetrical signatures (HMAC)

The certificate that will be used to check the signature will first be determined by calling this.getCertFromKeyInfo(), which function you can customize as you see fit. If that returns null, then publicCert is used. If that is null, then privateKey is used (for symmetrical signing applications).

Example:

new SignedXml({
  publicCert: client_public_pem,
  getCertFromKeyInfo: () => null,
});

You can use any dom parser you want in your code (or none, depending on your usage). This sample uses xmldom, so you should install it first:

npm install @xmldom/xmldom

Example:

var select = require("xml-crypto").xpath,
  dom = require("@xmldom/xmldom").DOMParser,
  SignedXml = require("xml-crypto").SignedXml,
  fs = require("fs");

var xml = fs.readFileSync("signed.xml").toString();
var doc = new dom().parseFromString(xml);

// DO NOT attempt to parse whatever data object you have here in `doc`
// and then use it to verify the signature. This can lead to security issues.
// i.e. BAD: parseAssertion(doc),
// good: see below

var signature = select(
  doc,
  "//*[local-name(.)='Signature' and namespace-uri(.)='http://www.w3.org/2000/09/xmldsig#']",
)[0];
var sig = new SignedXml({ publicCert: fs.readFileSync("client_public.pem") });
sig.loadSignature(signature);
try {
  var res = sig.checkSignature(xml);
} catch (ex) {
  console.log(ex);
}

In order to protect from some attacks we must check the content we want to use is the one that has been signed:

if (!res) {
  throw "Invalid Signature";
}
// good: The XML Signature has been verified, meaning some subset of XML is verified.
var signedBytes = sig.getSignedReferences();

var authenticatedDoc = new dom().parseFromString(signedBytes[0]); // Take the first signed reference
// It is now safe to load SAML, obtain the assertion XML, or do whatever else is needed.
// Be sure to only use authenticated data.
let signedAssertionNode = extractAssertion(authenticatedDoc);
let parsedAssertion = parseAssertion(signedAssertionNode);

return parsedAssertion; // This the correctly verified signed Assertion

// BAD example: DO not use the .getReferences() API.

Note:

The xml-crypto api requires you to supply it separately the xml signature ("<Signature>...</Signature>", in loadSignature) and the signed xml (in checkSignature). The signed xml may or may not contain the signature in it, but you are still required to supply the signature separately.

Caring for Implicit transform

If you fail to verify signed XML, then one possible cause is that there are some hidden implicit transforms(#).
(#) Normalizing XML document to be verified. i.e. remove extra space within a tag, sorting attributes, importing namespace declared in ancestor nodes, etc.

The reason for these implicit transform might come from complex xml signature specification, which makes XML developers confused and then leads to incorrect implementation for signing XML document.

If you keep failing verification, it is worth trying to guess such a hidden transform and specify it to the option as below:

var options = {
  implicitTransforms: ["http://www.w3.org/TR/2001/REC-xml-c14n-20010315"],
  publicCert: fs.readFileSync("client_public.pem"),
};
var sig = new SignedXml(options);
sig.loadSignature(signature);
var res = sig.checkSignature(xml);

You might find it difficult to guess such transforms, but there are typical transforms you can try.

API

xpath

See xpath.js for usage. Note that this is actually using another library as the underlying implementation.

SignedXml

The SignedXml constructor provides an abstraction for sign and verify xml documents. The object is constructed using new SignedXml(options?: SignedXmlOptions) where the possible options are:

  • idMode - default null - if the value of wssecurity is passed it will create/validate id's with the ws-security namespace.
  • idAttribute - string - default Id or ID or id - the name of the attribute that contains the id of the element
  • privateKey - string or Buffer - default null - the private key to use for signing
  • publicCert - string or Buffer - default null - the public certificate to use for verifying
  • signatureAlgorithm - string - the signature algorithm to use
  • canonicalizationAlgorithm - string - default undefined - the canonicalization algorithm to use
  • inclusiveNamespacesPrefixList - string - default null - a list of namespace prefixes to include during canonicalization
  • implicitTransforms - string[] - default [] - a list of implicit transforms to use during verification
  • keyInfoAttributes - object - default {} - a hash of attributes and values attrName: value to add to the KeyInfo node
  • getKeyInfoContent - function - default noop - a function that returns the content of the KeyInfo node
  • getCertFromKeyInfo - function - default SignedXml.getCertFromKeyInfo - a function that returns the certificate from the <KeyInfo /> node

API

A SignedXml object provides the following methods:

To sign xml documents:

  • addReference(xpath, transforms, digestAlgorithm) - adds a reference to a xml element where:
    • xpath - a string containing a XPath expression referencing a xml element
    • transforms - an array of transform algorithms, the referenced element will be transformed for each value in the array
    • digestAlgorithm - one of the supported hashing algorithms
  • computeSignature(xml, [options]) - compute the signature of the given xml where:
    • xml - a string containing a xml document
    • options - an object with the following properties:
      • prefix - adds this value as a prefix for the generated signature tags
      • attrs - a hash of attributes and values attrName: value to add to the signature root node
      • location - customize the location of the signature, pass an object with a reference key which should contain a XPath expression to a reference node, an action key which should contain one of the following values: append, prepend, before, after
      • existingPrefixes - A hash of prefixes and namespaces prefix: namespace that shouldn't be in the signature because they already exist in the xml
  • getSignedXml() - returns the original xml document with the signature in it, must be called only after computeSignature
  • getSignatureXml() - returns just the signature part, must be called only after computeSignature
  • getOriginalXmlWithIds() - returns the original xml with Id attributes added on relevant elements (required for validation), must be called only after computeSignature

To verify xml documents:

  • loadSignature(signatureXml) - loads the signature where:
    • signatureXml - a string or node object (like an xmldom node) containing the xml representation of the signature
  • checkSignature(xml) - validates the given xml document and returns true if the validation was successful

Customizing Algorithms

The following sample shows how to sign a message using custom algorithms.

First import some modules:

var SignedXml = require("xml-crypto").SignedXml,
  fs = require("fs");

Now define the extension point you want to implement. You can choose one or more.

To determine the inclusion and contents of a <KeyInfo /> element, the function this.getKeyInfoContent() is called. There is a default implementation of this. If you wish to change this implementation, provide your own function assigned to the property this.getKeyInfoContent. If you prefer to use the default implementation, assign SignedXml.getKeyInfoContent to this.getKeyInfoContent If there are no attributes and no contents to the <KeyInfo /> element, it won't be included in the generated XML.

To specify custom attributes on <KeyInfo />, add the properties to the .keyInfoAttributes property.

A custom hash algorithm is used to calculate digests. Implement it if you want a hash other than the built-in methods.

function MyDigest() {
  this.getHash = function (xml) {
    return "the base64 hash representation of the given xml string";
  };

  this.getAlgorithmName = function () {
    return "http://myDigestAlgorithm";
  };
}

A custom signing algorithm.

function MySignatureAlgorithm() {
  /*sign the given SignedInfo using the key. return base64 signature value*/
  this.getSignature = function (signedInfo, privateKey) {
    return "signature of signedInfo as base64...";
  };

  this.getAlgorithmName = function () {
    return "http://mySigningAlgorithm";
  };
}

Custom transformation algorithm.

function MyTransformation() {
  /*given a node (from the xmldom module) return its canonical representation (as string)*/
  this.process = function (node) {
    //you should apply your transformation before returning
    return node.toString();
  };

  this.getAlgorithmName = function () {
    return "http://myTransformation";
  };
}

Custom canonicalization is actually the same as custom transformation. It is applied on the SignedInfo rather than on references.

function MyCanonicalization() {
  /*given a node (from the xmldom module) return its canonical representation (as string)*/
  this.process = function (node) {
    //you should apply your transformation before returning
    return "< x/>";
  };

  this.getAlgorithmName = function () {
    return "http://myCanonicalization";
  };
}

Now you need to register the new algorithms:

/*register all the custom algorithms*/

signedXml.CanonicalizationAlgorithms["http://MyTransformation"] = MyTransformation;
signedXml.CanonicalizationAlgorithms["http://MyCanonicalization"] = MyCanonicalization;
signedXml.HashAlgorithms["http://myDigestAlgorithm"] = MyDigest;
signedXml.SignatureAlgorithms["http://mySigningAlgorithm"] = MySignatureAlgorithm;

Now do the signing. Note how we configure the signature to use the above algorithms:

function signXml(xml, xpath, key, dest) {
  var options = {
    publicCert: fs.readFileSync("my_public_cert.pem", "latin1"),
    privateKey: fs.readFileSync(key),
    /*configure the signature object to use the custom algorithms*/
    signatureAlgorithm: "http://mySignatureAlgorithm",
    canonicalizationAlgorithm: "http://MyCanonicalization",
  };

  var sig = new SignedXml(options);

  sig.addReference({
    xpath: "//*[local-name(.)='x']",
    transforms: ["http://MyTransformation"],
    digestAlgorithm: "http://myDigestAlgorithm",
  });

  sig.addReference({
    xpath,
    transforms: ["http://MyTransformation"],
    digestAlgorithm: "http://myDigestAlgorithm",
  });
  sig.canonicalizationAlgorithm = "http://www.w3.org/2001/10/xml-exc-c14n#";
  sig.signatureAlgorithm = "http://www.w3.org/2000/09/xmldsig#rsa-sha1";
  sig.computeSignature(xml);
  fs.writeFileSync(dest, sig.getSignedXml());
}

var xml = "<library>" + "<book>" + "<name>Harry Potter</name>" + "</book>";
("</library>");

signXml(xml, "//*[local-name(.)='book']", "client.pem", "result.xml");

You can always look at the actual code as a sample.

Asynchronous signing and verification

If the private key is not stored locally, and you wish to use a signing server or Hardware Security Module (HSM) to sign documents, you can create a custom signing algorithm that uses an asynchronous callback.

function AsyncSignatureAlgorithm() {
  this.getSignature = function (signedInfo, privateKey, callback) {
    var signer = crypto.createSign("RSA-SHA1");
    signer.update(signedInfo);
    var res = signer.sign(privateKey, "base64");
    //Do some asynchronous things here
    callback(null, res);
  };
  this.getAlgorithmName = function () {
    return "http://www.w3.org/2000/09/xmldsig#rsa-sha1";
  };
}

var sig = new SignedXml({ signatureAlgorithm: "http://asyncSignatureAlgorithm" });
sig.SignatureAlgorithms["http://asyncSignatureAlgorithm"] = AsyncSignatureAlgorithm;
sig.signatureAlgorithm = "http://asyncSignatureAlgorithm";
sig.canonicalizationAlgorithm = "http://www.w3.org/2001/10/xml-exc-c14n#";
sig.computeSignature(xml, opts, function (err) {
  var signedResponse = sig.getSignedXml();
});

The function sig.checkSignature may also use a callback if asynchronous verification is needed.

X.509 / Key formats

Xml-Crypto internally relies on node's crypto module. This means pem encoded certificates are supported. So to sign an xml use key.pem that looks like this (only the beginning of the key content is shown):

-----BEGIN PRIVATE KEY-----
MIICdwIBADANBgkqhkiG9w0...
-----END PRIVATE KEY-----

And for verification use key_public.pem:

-----BEGIN CERTIFICATE-----
MIIBxDCCAW6gAwIBAgIQxUSX...
-----END CERTIFICATE-----

Converting .pfx certificates to pem

If you have .pfx certificates you can convert them to .pem using openssl:

openssl pkcs12 -in c:\certs\yourcert.pfx -out c:\certs\cag.pem

Then you could use the result as is for the purpose of signing. For the purpose of validation open the resulting .pem with a text editor and copy from -----BEGIN CERTIFICATE----- to -----END CERTIFICATE----- (including) to a new text file and save it as .pem.

Examples

how to sign a root node (coming soon)

how to add a prefix for the signature

Use the prefix option when calling computeSignature to add a prefix to the signature.

var SignedXml = require("xml-crypto").SignedXml,
  fs = require("fs");

var xml = "<library>" + "<book>" + "<name>Harry Potter</name>" + "</book>" + "</library>";

var sig = new SignedXml({ privateKey: fs.readFileSync("client.pem") });
sig.addReference({
  xpath: "//*[local-name(.)='book']",
  digestAlgorithm: "http://www.w3.org/2000/09/xmldsig#sha1",
  transforms: ["http://www.w3.org/2001/10/xml-exc-c14n#"],
});
sig.canonicalizationAlgorithm = "http://www.w3.org/2001/10/xml-exc-c14n#";
sig.signatureAlgorithm = "http://www.w3.org/2000/09/xmldsig#rsa-sha1";
sig.computeSignature(xml, {
  prefix: "ds",
});

how to specify the location of the signature

Use the location option when calling computeSignature to move the signature around. Set action to one of the following:

  • append(default) - append to the end of the xml document
  • prepend - prepend to the xml document
  • before - prepend to a specific node (use the referenceNode property)
  • after - append to specific node (use the referenceNode property)
var SignedXml = require("xml-crypto").SignedXml,
  fs = require("fs");

var xml = "<library>" + "<book>" + "<name>Harry Potter</name>" + "</book>" + "</library>";

var sig = new SignedXml({ privateKey: fs.readFileSync("client.pem") });
sig.addReference({
  xpath: "//*[local-name(.)='book']",
  digestAlgorithm: "http://www.w3.org/2000/09/xmldsig#sha1",
  transforms: ["http://www.w3.org/2001/10/xml-exc-c14n#"],
});
sig.canonicalizationAlgorithm = "http://www.w3.org/2001/10/xml-exc-c14n#";
sig.signatureAlgorithm = "http://www.w3.org/2000/09/xmldsig#rsa-sha1";
sig.computeSignature(xml, {
  location: { reference: "//*[local-name(.)='book']", action: "after" }, //This will place the signature after the book element
});

more examples (coming soon)

Development

The testing framework we use is Mocha with Chai as the assertion framework.

To run tests use:

npm test

More information

Visit my blog or my twitter

Bitdeli Badge

License

This project is licensed under the MIT License. See the LICENSE file for more info.

changelog

Changelog

6.1.1 (2025-04-21)

🚀 Minor Changes

  • [enhancement] Adjust deprecation to better reflect real-world usage #499

v6.1.0 (2025-04-09)

🙈 Other

  • [closed] Introduce new .getSignedReferences() function of signature to help prevent signature wrapping attacks #489

v6.0.1 (2025-03-14)

  • Address CVEs: CVE-2025-29774 and CVE-2025-29775

v6.0.0 (2024-01-26)

💣 Major Changes

  • [breaking-change] Set getCertFromKeyInfo to noop #445

🔗 Dependencies

  • [dependencies] [github_actions] Bump github/codeql-action from 2 to 3 #434

📚 Documentation

  • [documentation] Chore: Update README.md #432

v5.1.1 (2024-01-17)

🐛 Bug Fixes

  • [bug] fix: template literal #443

v5.1.0 (2024-01-07)

🚀 Minor Changes

  • [enhancement] Enhance derToPem to support XML pretty-print #439

🔗 Dependencies

  • [dependencies] [javascript] Bump @typescript-eslint/parser from 6.13.0 to 6.18.1 #442
  • [dependencies] [javascript] Bump @typescript-eslint/eslint-plugin from 6.13.0 to 6.18.1 #441
  • [dependencies] [javascript] Bump follow-redirects from 1.15.3 to 1.15.4 #440
  • [dependencies] [javascript] Bump eslint from 8.54.0 to 8.56.0 #436
  • [dependencies] [javascript] Bump @types/node from 16.18.65 to 16.18.69 #435
  • [dependencies] [javascript] Bump release-it from 16.2.1 to 16.3.0 #428

v5.0.0 (2023-11-27)

💣 Major Changes

  • [breaking-change] Mark getKeyInfo() private as it has no public consumers #412
  • [breaking-change] Remove the default for getKeyInfoContent forcing a consumer to choose #411
  • [documentation] [breaking-change] Remove default for transformation algorithm #410
  • [breaking-change] Remove default for signature algorithm #408
  • [breaking-change] Remove default for digest algorithm #406
  • [breaking-change] Remove default canonicalization algorithm #405
  • [chore] [breaking-change] Improve code clarity; remove unused functions #397
  • [breaking-change] Move validation messages to each reference #396
  • [breaking-change] Make references accessible only via get/set #395
  • [chore] [breaking-change] Reduce public interface by making some methods private #394
  • [chore] [breaking-change] Update build to support Node@16 #385

🚀 Minor Changes

  • [enhancement] Add support for directly querying a node to see if it has passed validation #389
  • [enhancement] Add method for checking if element is signed #368

🔗 Dependencies

  • [dependencies] [javascript] Bump @typescript-eslint/eslint-plugin from 5.62.0 to 6.13.0 #422
  • [dependencies] [javascript] Bump @prettier/plugin-xml from 3.2.1 to 3.2.2 #423
  • [dependencies] [javascript] Bump @types/mocha from 10.0.2 to 10.0.6 #421
  • [dependencies] [javascript] Bump @types/chai from 4.3.6 to 4.3.11 #419
  • [dependencies] [javascript] Bump prettier from 3.0.3 to 3.1.0 #418
  • [dependencies] [javascript] Bump typescript from 5.2.2 to 5.3.2 #415
  • [dependencies] [javascript] Bump eslint from 8.51.0 to 8.54.0 #414
  • [dependencies] [github_actions] Bump actions/setup-node from 3 to 4 #413
  • [dependencies] [javascript] Bump @babel/traverse from 7.22.4 to 7.23.2 #407
  • [dependencies] [github_actions] Bump actions/checkout from 3 to 4 #392
  • [dependencies] [javascript] Bump eslint-plugin-deprecation from 1.4.1 to 2.0.0 #390
  • [dependencies] [javascript] Bump typescript from 5.1.6 to 5.2.2 #383
  • [dependencies] [javascript] Bump eslint-config-prettier from 8.8.0 to 9.0.0 #381
  • [dependencies] Update dependencies; move to @xmldom-scoped is-dom-node package #402

🐛 Bug Fixes

  • [bug] Ensure the X509Certificate tag is properly prefixed #377
  • [bug] Fix transform processing regression #379
  • [bug] Enforce consistent transform processing #380

📚 Documentation

  • [documentation] Clarify use of <KeyInfo /> in signature validation #401

⚙️ Technical Tasks

  • [chore] Use is-dom-node for DOM node checking and narrowing #388
  • [chore] Improve and simplify validation logic #373
  • [chore] Add additional type checking #369

v4.1.0 (2023-07-28)

💣 Major Changes

  • [bug] [breaking-change] Fix pemToDer() return type #364

⚙️ Technical Tasks

  • [chore] Improve exported typings #367
  • [chore] Use stricter typing in tests #366
  • [chore] Consistently reference xmldom #365
  • [chore] Rename findChilds() to findChildren() #363

v4.0.1 (2023-07-22)

🐛 Bug Fixes

  • [bug] Use correct type for options #360
  • [bug] Fix validationErrors type #361

v4.0.0 (2023-07-21)

💣 Major Changes

  • [documentation] [breaking-change] Expand the options, move idmode into options, fix types #323
  • [breaking-change] Refactor classes into their own files #318
  • [breaking-change] Prefer ES6 classes to prototypical inheritance #316
  • [breaking-change] Rename signingCert -> publicCert and signingKey -> privateKey #315
  • [semver-major] [breaking-change] Add support for <X509Certificate /> in <KeyInfo />; remove KeyInfoProvider #301
  • [semver-major] Target an LTS version of Node #299

🚀 Minor Changes

  • [enhancement] Exports C14nCanonicalization, ExclusiveCanonicalization #336

🔗 Dependencies

  • [dependencies] [javascript] Bump @xmldom/xmldom from 0.8.8 to 0.8.10 #358
  • [dependencies] [javascript] Bump @typescript-eslint/eslint-plugin from 5.60.1 to 5.62.0 #357
  • [dependencies] [javascript] Bump @prettier/plugin-xml from 2.2.0 to 3.1.1 #356
  • [dependencies] [javascript] Bump prettier from 2.8.8 to 3.0.0 #350
  • [dependencies] [javascript] Bump release-it from 15.11.0 to 16.1.3 #352
  • [dependencies] [javascript] Bump prettier-plugin-packagejson from 2.4.3 to 2.4.5 #353
  • [dependencies] [javascript] Bump @typescript-eslint/parser from 5.60.1 to 5.62.0 #354
  • [dependencies] [javascript] Bump typescript from 5.1.5 to 5.1.6 #351
  • [dependencies] [javascript] Bump word-wrap from 1.2.3 to 1.2.4 #348
  • [dependencies] [javascript] Bump eslint from 8.42.0 to 8.45.0 #344
  • [dependencies] Update gren for better support for branches #340
  • [dependencies] [github_actions] Bump codecov/codecov-action from 3.1.1 to 3.1.4 #290

🐛 Bug Fixes

  • [bug] Fix issue in case when namespace has no prefix #330
  • [bug] Use correct path for code coverage reports #302

⚙️ Technical Tasks

  • [chore] Enforce eslint no-unused-vars #349
  • [chore] Enforce eslint deprecation #347
  • [chore] Enforce eslint prefer-template #346
  • [chore] Enforce eslint no-this-alias #345
  • [chore] Convert this project to TypeScript #325
  • [chore] Rename files in preparation for TS migration #343
  • [chore] Don't force master branch when generating changelog #342
  • [chore] Enforce eslint no-unused-vars #322
  • [chore] Enforce eslint no-prototype-builtins #321
  • [chore] Enforce eslint eqeqeq rule #320
  • [chore] Update types #319
  • [chore] Adjust code to pass eslint prefer-const #312
  • [chore] Adjust code to pass eslint no-var #311
  • [chore] Adjust code to pass eslint curly #310
  • [chore] Adjust code to pass eslint one-var #309
  • [chore] Typings #295
  • [chore] Lint code for new linting rules #300
  • [chore] Make linting rules more strict #293
  • [chore] Replace Nodeunit with Mocha #294

v3.1.0 (2023-06-05)

🚀 Minor Changes

  • [enhancement] Add support for appending attributes to KeyInfo element #285
  • [enhancement] Use inclusiveNamespacesPrefixList to generate InclusiveNamespaces #284
  • [enhancement] build: add release-it to facilitate builds #275
  • [enhancement] [documentation] feat: add type declaration #277
  • [enhancement] make FileKeyInfo extensible for compatibility with TypeScript #273
  • [enhancement] Updated getKeyInfo function with actual implementation #249

🔗 Dependencies

  • [dependencies] Update dependencies #296
  • [dependencies] Bump minimatch from 3.0.4 to 3.1.2 #276
  • [dependencies] [javascript] Bump qs from 6.5.2 to 6.5.3 #271

📚 Documentation

  • [documentation] [chore] Adjust references for node-saml organization #298

⚙️ Technical Tasks

  • [chore] Force CI to run on every PR #286
  • [chore] Format code #289
  • [chore] Lint code #288
  • [chore] Add support for linting #287

v3.0.1 (2022-10-31)

🔗 Dependencies

  • [dependencies] [javascript] Bump ajv and har-validator #266
  • [dependencies] [javascript] Bump yargs-parser and tap #257
  • [dependencies] [javascript] Bump minimist and tap #264

v3.0.0 (2022-10-13)

🔗 Dependencies

  • [dependencies] [javascript] Bump @xmldom/xmldom from 0.7.0 to 0.8.3 #261
  • [dependencies] [javascript] Bump handlebars from 4.0.11 to 4.7.7 #247
  • [dependencies] [javascript] Bump lodash from 4.17.10 to 4.17.21 #248
  • [dependencies] [javascript] Bump hosted-git-info from 2.6.0 to 2.8.9 #246
  • [dependencies] [javascript] Bump ejs from 2.6.1 to 3.1.7 #244
  • [dependencies] [javascript] Bump path-parse from 1.0.5 to 1.0.7 #245

⚙️ Technical Tasks

  • [chore] build(ci): test on later node versions #251

v2.1.4 (2022-07-08)

🐛 Bug Fixes

  • [bug] Correct behavior for XML canonicalization with namespaces and nested elements #242

v2.1.3 (2021-08-20)

🔗 Dependencies

  • [dependencies] [javascript] [security] Update xmldom to 0.7.0 #236
  • [dependencies] [java] Bump commons-io from 2.4 to 2.7 in /test/validators/XmlCryptoJava #229

v2.1.2 (2021-04-19)

No changelog for this release.


v2.1.1 (2021-03-16)

No changelog for this release.


v2.1.0 (2021-03-15)

🔗 Dependencies

  • [dependencies] [javascript] Bump xmldom from 0.1.27 to 0.5.0 #225
  • [dependencies] [java] Bump junit from 4.12 to 4.13.1 in /test/validators/XmlCryptoJava #217

🐛 Bug Fixes

  • [bug] fix for #201 #218

⚙️ Technical Tasks

  • [chore] Don't pull the example folder into the module build #220

v2.0.0 (2020-10-05)

No changelog for this release.


v1.5.3 (2020-04-14)

🚀 Minor Changes

  • [enhancement] Async response for built in algo sign/verify #209

v1.5.2 (2020-04-13)

No changelog for this release.


v1.5.1 (2020-04-13)

🐛 Bug Fixes

  • [bug] Test suites of other projects (mocha) that include v1.5.0 fail #207

v1.5.0 (2020-04-12)

🚀 Minor Changes

  • [enhancement] Add callback options to sign/verify asynchronously #206

v1.4.1 (2020-04-03)

🔗 Dependencies

  • [dependencies] Bump js-yaml from 3.12.0 to 3.13.1 #205

🐛 Bug Fixes

  • [bug] validation instruction typo #192
  • [bug] Fixes line end and white space normalization. #196

v1.4.0 (2019-04-26)

🐛 Bug Fixes

  • [bug] Fix canon xml being computed differently when signing, than when verifying #183

v1.3.0 (2019-03-23)

🐛 Bug Fixes

  • [bug] Xml enc c14# inclusivenamespace fixes #179

v1.2.0 (2019-02-26)

🐛 Bug Fixes

  • [bug] Accept existing xml prefixes to avoid adding to signature #171

v1.1.4 (2019-02-11)

🐛 Bug Fixes

  • [bug] fix for enveloped signatures #174

v1.1.3 (2019-02-10)

🐛 Bug Fixes

  • [bug] Update signed-xml.js #172

v1.1.2 (2019-01-28)

No changelog for this release.


v1.1.1 (2019-01-01)

No changelog for this release.


v1.1.0 (2019-01-01)

No changelog for this release.


v1.0.2 (2018-11-08)

🐛 Bug Fixes

  • [bug] Bugfix: a namespace in the inclusive namespace list should be treated… #163

v1.0.1 (2018-09-10)

No changelog for this release.


v1.0.0 (2018-09-10)

🔗 Dependencies

  • [dependencies] Addresses issue #235 by upgrading xmldom version to 0.1.27 #155

🐛 Bug Fixes

  • [bug] Decode DigestValue for validation #160
  • [bug] Patch for non exclusive c14n #157
  • [bug] Merge changes from datagovsg fork #161

v0.9.0 (2017-02-26)

No changelog for this release.


0.9.0 (2017-02-26)

🚀 Minor Changes

  • [enhancement] Separate namespaces with same prefix but different URI #117

🐛 Bug Fixes


v0.8.5 (2016-12-08)

🚀 Minor Changes

  • [enhancement] Add possible id attribute 'id' #121

📚 Documentation

  • [documentation] Update license field to npm recommendation #119
  • [documentation] Fix author field format #120
  • [documentation] Remove namespace-breaking reserialization of signature from example in README #105

v0.8.4 (2016-03-12)

No changelog for this release.


v0.8.3 (2016-03-06)

No changelog for this release.


v0.8.2 (2015-12-13)

No changelog for this release.


v0.8.1 (2015-10-15)

No changelog for this release.


v0.8.0 (2015-10-03)

No changelog for this release.


V1 (2013-07-20)

No changelog for this release.