You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’m having trouble getting InclusiveNamespaces to work like intended. It would be great to have an example in the library documentation that shows how to achieve this.
The difference between the two is the missing InclusiveNamespaces children, with PrefixList and ec namespaces.
How can I pass these values to the CanonicalizationMethod and Transforms?
Thanks for creating and maintaining this library!
The text was updated successfully, but these errors were encountered:
crabey
changed the title
Documentation for how to add InclusiveNamespaces and PrefixList to CanonicalizationMethod and Transform
Documentation for adding InclusiveNamespaces and PrefixList to CanonicalizationMethod and Transforms
Jun 25, 2019
@zygimantus yes, I changed some things in signed-xml.js. Some of these changes use hardcoded values that are specific for my use case. But it does work for me, so maybe it can be helpful for you as well. Just tweak it to your requirements.
let i = 0; // Add this to beginning of file.
// Make this if statement add KeyInfo ID.
if (this.keyInfoProvider) {
res += "<" + currentPrefix + `KeyInfo Id="<your key here>">`
res += this.keyInfoProvider.getKeyInfo(this.signingKey, prefix)
res += "</" + currentPrefix + "KeyInfo>"
}
// Comment out the line below, and add the following
// res += "<" + prefix + "Transform Algorithm=\"" + transform.getAlgorithmName() + "\" />"
res += "<" + prefix + "Transform Algorithm=\"" + transform.getAlgorithmName() + "\">"
if (i === 0) {
res += '<ec:InclusiveNamespaces xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList="wsse soapenv urn urn1 urn2"/>'
ref.inclusiveNamespacesPrefixList = 'wsse soapenv urn urn1 urn2';
}
if (i === 1) {
res += '<ec:InclusiveNamespaces xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList="urn urn1 urn2"/>'
ref.inclusiveNamespacesPrefixList = 'urn urn1 urn2';
}
res += "</" + prefix + "Transform>"
i = i + 1;
Hello
I’m having trouble getting InclusiveNamespaces to work like intended. It would be great to have an example in the library documentation that shows how to achieve this.
I want my XML SignedInfo part to look like this:
This is what I’m currently getting:
The difference between the two is the missing InclusiveNamespaces children, with PrefixList and ec namespaces.
How can I pass these values to the CanonicalizationMethod and Transforms?
Thanks for creating and maintaining this library!
The text was updated successfully, but these errors were encountered: