Sha256: 83fb0a5712479d9ae3ae0d566b4a86053c13e9699f52d5568541688a3af7e87c
Contents?: true
Size: 753 Bytes
Versions: 3
Compression:
Stored size: 753 Bytes
Contents
module Xmldsig class SignedDocument attr_accessor :document def initialize(document, options = {}) @document = Nokogiri::XML::Document.parse(document) 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
3 entries across 3 versions & 2 rubygems
Version | Path |
---|---|
xmldsig-fiscalizer-0.2.4 | lib/xmldsig/signed_document.rb |
xmldsig-0.2.4 | lib/xmldsig/signed_document.rb |
xmldsig-0.2.3 | lib/xmldsig/signed_document.rb |