Sha256: d5547ae2b4aa259c4aec724d521117335278617b652f8f84865624bd3da8fd47

Contents?: true

Size: 847 Bytes

Versions: 13

Compression:

Stored size: 847 Bytes

Contents

module Xmldsig
  class Transforms < Array

    def apply(node)
      @node = node
      each do |transform_node|
        @node = get_transform(@node, transform_node).transform
      end
      @node
    end

    private

    def get_transform(node, transform_node)
      case transform_node.get_attribute("Algorithm")
        when "http://www.w3.org/2000/09/xmldsig#enveloped-signature"
          Transforms::EnvelopedSignature.new(node, transform_node)
        when "http://www.w3.org/2001/10/xml-exc-c14n#",
            "http://www.w3.org/TR/2001/REC-xml-c14n-20010315",
            "http://www.w3.org/2006/12/xml-c14n11"
          Transforms::Canonicalize.new(node, transform_node)
        when "http://www.w3.org/2001/10/xml-exc-c14n#WithComments"
          Transforms::Canonicalize.new(node, transform_node, true)
      end
    end

  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
xmldsig-0.6.5 lib/xmldsig/transforms.rb
xmldsig-0.6.4 lib/xmldsig/transforms.rb
xmldsig-0.6.3 lib/xmldsig/transforms.rb
xmldsig-0.6.2 lib/xmldsig/transforms.rb
xmldsig-0.6.1 lib/xmldsig/transforms.rb
xmldsig-0.5.1 lib/xmldsig/transforms.rb
xmldsig-0.5.0 lib/xmldsig/transforms.rb
xmldsig-0.4.1 lib/xmldsig/transforms.rb
xmldsig-0.4.0 lib/xmldsig/transforms.rb
xmldsig-0.3.2 lib/xmldsig/transforms.rb
xmldsig-0.3.1 lib/xmldsig/transforms.rb
xmldsig-0.3.0 lib/xmldsig/transforms.rb
xmldsig-0.2.10 lib/xmldsig/transforms.rb