Class: Moxml::Signature::Verifier
- Inherits:
-
Object
- Object
- Moxml::Signature::Verifier
- Defined in:
- lib/moxml/signature/verifier.rb
Overview
Core Validation per spec ยง3.2, with the safe ordering prescribed by Best Practice 1: verify SignatureValue BEFORE running any reference transforms (which could be hostile).
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#document ⇒ Object
readonly
Returns the value of attribute document.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#key_map ⇒ Object
readonly
Returns the value of attribute key_map.
Instance Method Summary collapse
-
#initialize(context:, document:, key: nil, key_map: {}, **_options) ⇒ Verifier
constructor
A new instance of Verifier.
- #verify ⇒ Object
Constructor Details
#initialize(context:, document:, key: nil, key_map: {}, **_options) ⇒ Verifier
Returns a new instance of Verifier.
11 12 13 14 15 16 |
# File 'lib/moxml/signature/verifier.rb', line 11 def initialize(context:, document:, key: nil, key_map: {}, **) @context = context @document = document @key = key @key_map = key_map || {} end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
9 10 11 |
# File 'lib/moxml/signature/verifier.rb', line 9 def context @context end |
#document ⇒ Object (readonly)
Returns the value of attribute document.
9 10 11 |
# File 'lib/moxml/signature/verifier.rb', line 9 def document @document end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
9 10 11 |
# File 'lib/moxml/signature/verifier.rb', line 9 def key @key end |
#key_map ⇒ Object (readonly)
Returns the value of attribute key_map.
9 10 11 |
# File 'lib/moxml/signature/verifier.rb', line 9 def key_map @key_map end |
Instance Method Details
#verify ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/moxml/signature/verifier.rb', line 18 def verify Algorithms.load_builtins! signatures = find_signatures results = signatures.map { |sig_elem| verify_one(sig_elem) } VerificationResult.new(results: results) end |