Questions tagged [c14n]

Canonical XML [XML-C14N] specifies a standard serialization of XML.

Canonical XML when applied to a subdocument must include the subdocument's ancestor context including all of the namespace declarations and attributes in the xml: namespace https://www.w3.org/TR/xml-exc-c14n/

17 questions
10
votes
0 answers

Wrong canonicalization (c14n) made by SignedXml - it removes line breaks ( ) - is it a .NET bug?

We are receiving signed xmls from third parties which are using java. Our .NET implementation validates correctly the signatures, except when the xml contain the character reference. It looks like .NET removes that line break character…
csg
  • 2,047
  • 2
  • 22
  • 35
4
votes
1 answer

Write ElementTree as canonicalized XML (c14n)

The ElementTree class in the Python xml.etree API has a write() method that documents the optional method argument: *method* -- either "xml" (default), "html, "text", or "c14n" At least with Python 3.5 (on Fedora 25) writing with this method import…
maxschlepzig
  • 35,645
  • 14
  • 145
  • 182
3
votes
1 answer

lxml - TypeError: write() got an unexpected keyword argument 'default_namespace'

Below is a minimal working example. I have tested this with Python 3.4, Python 3.6 32 bit and Python 3.6 64 bit. import io from lxml import etree test_node = etree.fromstring('''
nagylzs
  • 3,954
  • 6
  • 39
  • 70
3
votes
0 answers

xmllint canonicalization is not sorting for elements and all child elements

how can We sort the below output using xmllint c14n option. I have tried below options but i don't see any sorting happening here. I'm expecting all elements and child elements to be sorted. xmllint c14n xmllint --exc-c14n
Babu K T
  • 41
  • 4
2
votes
0 answers

Canonicalise XML file using PowerShell

Is there an inbuilt mechanism within PowerShell (or within .NET that can be used by PowerShell) that will allow me to canonicalise an XML file (see step 2 below)? The canonicalisation must be based on the W3C rules described at…
gerard
  • 835
  • 11
  • 27
1
vote
1 answer

XML Canonicalization for elements with namespaces

Canonical XML standard https://www.ietf.org/rfc/rfc3076.txt contains various examples but none with the input document having a namespace on the element name. So what is the canonical form of
Juergen
  • 55
  • 1
  • 5
1
vote
0 answers

PHP C14N() change characters inside CDATA

I have an xml that I must sign, however when I send it it has a structure something like this: UTF-8
1
vote
0 answers

Java c14N Canonicaliser - Attribute name order is in the wrong order

Java c14n Canonicalizer is switching up the attribute order of the canonicalized XML assertion. The canonicalizer is outputting the following string post canonicaliztion:
Srikar
  • 11
  • 1
1
vote
0 answers

Wrong DigestValue: "Hash values do not match" XML with PHP

I am trying to sign an XML file and in all the requests I make I get the error "Hash values ​​do not match." This is my XML
1
vote
0 answers

Why not working canonicalizer XML in nojejs xml-c14n

I have problem in XML, when I need that a element child contain Parent's attributes in Nodejs. Now only atribute show in child canonicalized is xmlns, but, for instance, there are attributes xmlns:ns1, xmlns:types, the attributes don't in child…
1
vote
1 answer

Nokogiri::XML::document canonicalize method returns empty string

I wanted to get a canonicalized version of a piece of xml by using nokogiri, though its canonicalize method is returnin an empty string. d= Nokogiri::XML::Document.new 'e' d.canonicalize #=> "" Does anybody know what am I…
Pedro Rolo
  • 28,273
  • 12
  • 60
  • 94
0
votes
1 answer

Don't find how to calculate the correct DigestValue of my XML - C#

I need to perform the calculation of the digestValue of a SignedInfo balise from my XMLDocument. Instructions provided are : Perform XML canonicalisation on the DataPDU (including start and end tags of DataPDU) and compute the SHA256 digest of the…
Nominak
  • 1
  • 1
0
votes
0 answers

Problems with XML digest value (for The Danish Health Data Authority)

I want to create some XML which has to contain a digest value, i.e., a BASE64 encoded hash value of some of the XML in canonical (C14N) form, but the receiver does not accept the value my code calculates nor the XML when done according to the…
Andrew Rump
  • 133
  • 1
  • 1
  • 10
0
votes
1 answer

XmlStar usage in C#

I am trying to canonicalize a few xml documents. As I see it can be achieved by using XmlStar by executing a CMD command xml c14n --exc-without-comments test_xml.xml > test_xml_canonicalize.xml My question is can the same result be achieved with C#…
dmxyler
  • 79
  • 1
  • 1
  • 14
1
2