Questions tagged [canonicalization]

is a process for converting data that has more than one possible representation into a "standard", "normal", or canonical form.

As per Wikipedia:

In computer science, canonicalization (abbreviated c14n, where 14 represents the number of letters between the C and the N; also sometimes standardization or normalization) is a process for converting data that has more than one possible representation into a "standard", "normal", or canonical form. This can be done to compare different representations for equivalence, to count the number of distinct data structures, to improve the efficiency of various algorithms by eliminating repeated calculations, or to make it possible to impose a meaningful sorting order.

197 questions
1
vote
1 answer

Error while trying to canonize XML fragments in XML::LibXML

I am trying to canonize a XML fragment to avoid printing of self closing nodes in the resultant XML. ( i want node to be streamed as due to constraints at the consuming system ). I tried to use toStringC14N() method in the…
angel_007
  • 103
  • 6
1
vote
1 answer

Matching URLs with normalisation/canonicalisation

I found this solution to normalise and match equal URLs but I want to know if there is anything more elegant, doesn't PHP have a URL normalising function? function urlMatch($url1, $url2) { // parse the urls $r1 = parse_url($url1); $r2 =…
el_pup_le
  • 11,711
  • 26
  • 85
  • 142
1
vote
1 answer

piping two sax parsers?

I have the following implementation task and I have no good idea how to solve it. We have a SAX-based syntax-checker for a xml format that checks a hashsum in some closing endElement(). This hashsum is built using a kind of filtering InputStream…
Bastl
  • 2,926
  • 5
  • 27
  • 48
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
1 answer

.htaccess 301 redirect only work for 1 new link

I have .htaccess file with redirect 301 on it and placed right under the rewriteengine RewriteEngine On #now this is the redirect Redirect 301 /blog.php?slug=konsolidasi-tanah-frequently-asked-questions…
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
1 answer

How to properly change Canonicalization Method in this Java code?

I'm using import org.apache.xml.security.c14n.Canonicalizer; in my code, and the line used to Canonicalize the signature looks like…
Prothy
  • 47
  • 2
  • 7
1
vote
1 answer

XML Canonicalization returns empty elements in the transformed output

I have a related post asking how to select nodes from an XmlDocument using an XPath statement. The only way I could get the SelectNodes to work was to create a non default namespace "x" and then explicitly reference the nodes in the XPath…
TeamWild
  • 2,460
  • 8
  • 43
  • 53
1
vote
1 answer

Using Xpath With Default Namespace in C# for Canonicalisation

I'm trying to apply the C14N transform to some generated XML. It appears I can't use LINQ to retrieve the nodes to perform the canonicalisation so I have to go 'old school' with the DOM but I think I'm falling foul of the default namespace. Here is…
TeamWild
  • 2,460
  • 8
  • 43
  • 53
1
vote
1 answer

OpenSSL: how to get x509 -subject_hash "manually"?

I'm trying to get the same result as openssl X509 -in certificate.pem -subject_hash without using the function directly but instead by extracting the cerrtificate name and building the propper canonical representation to then take the sha-1 hash…
matthias_buehlmann
  • 4,641
  • 6
  • 34
  • 76
1
vote
1 answer

Consolidate duplicate URLs analytics with Canonical URLs when using Google Tag Manager

I have GTM installed on my site. We already have canonical URLs on all of our pages, but Google Analytics is not tracking the canonical URLs, so the analytics are getting duplicate pages where the capitalization or querystrings are different. I've…
1
vote
0 answers

Canonicalized JSON string

I have an object which I use NewtonSoft JSON to deserialize to string Jsonstring = JsonConvert.SerializeObject(InfoObject) Is there a way I can convert to Canonicalized JSON string. I couldn't find anyway with NewtonSoft JSON. The sorting needs to…
1
vote
2 answers

Average over diagonally in a Matrix

I have a matrix. e.g. 5 x 5 matrix $ cat input.txt 1 5.6 3.4 2.2 -9.99E+10 2 3 2 2 -9.99E+10 2.3 3 7 4.4 5.1 4 5 6 7 8 5 -9.99E+10 9 11 …
Kay
  • 1,957
  • 2
  • 24
  • 46
1
vote
1 answer

Processing the SignedProperties node in XaDeS XML Signature(C++)

So I'm trying to compute the digest value of the SignedProperties element according to XaDeS-EPES signature standard but I always get an incorrect digest value. I know the steps to follow, which are canonicalization of the node(according to XML…
1
vote
1 answer

.htaccess code questions about SSL and canonicalization

In short, my website has a single payments page. SSL certificate is installed but is not required apart for that one payments page. With regards to my .htaccess file - I currently separate my payments page with the following code. I also block…