Sha256: 290970774966f8f6f3c1e75311de06fc4ebea9c9ab0a862943c403ca7e8f8f0e
Contents?: true
Size: 784 Bytes
Versions: 1
Compression:
Stored size: 784 Bytes
Contents
module Xmldsig class SignedDocument attr_accessor :document def initialize(document, options = {}) @document = Nokogiri::XML(document, nil, nil, Nokogiri::XML::ParseOptions::STRICT) end def validate(certificate = nil, &block) signatures.any? && signatures.all? { |signature| signature.valid?(certificate, &block) } end def sign(private_key = nil, instruct = true, &block) signatures.each { |signature| signature.sign(private_key, &block) } instruct ? @document.to_s : @document.root.to_s end def signed_nodes signatures.flat_map(&:references).map(&:referenced_node) end def signatures document.xpath("//ds:Signature", NAMESPACES).reverse.collect { |node| Signature.new(node) } || [] end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
xmldsig-0.2.5 | lib/xmldsig/signed_document.rb |