Canonicalizing XML in Ruby

Posted by whazzmaster on Stack Overflow See other posts from Stack Overflow or by whazzmaster
Published on 2010-06-14T16:04:38Z Indexed on 2010/06/15 15:52 UTC
Read the original article Hit count: 251

Filed under:
|
|

I'm working on a SAML gateway using Ruby/Rails and I'm attempting to write some code that validates the xml digital signature of the incoming SAML response against the x509 cert of the originating service.

My problem: the signature depends on a canonicalized version of the XML that is hashed and then signed and I'm having trouble finding a ruby lib/gem that will canonicalize XML per the spec. I found a super old gem on rubyforge that is a mess but I'd be more interested if something like nokogiri supported this kind of functionality (from the nokogiri docs, it doesn't).

I've googled extensively but thought I'd ask around here to see if anyone has any good insights before I go and try to write my own version or rework the existing c14n-r library.

© Stack Overflow or respective owner

Related posts about ruby

Related posts about digital-signature