Class: Moxml::Signature::Parser
- Inherits:
-
Object
- Object
- Moxml::Signature::Parser
- Defined in:
- lib/moxml/signature/parser.rb
Overview
Translates a Moxml::Document containing ds:Signature into a Model::Signature.
Robust against namespace prefix variations (ds:, dsig:, default ns).
Constant Summary collapse
- DS =
{ "ds" => DSIG_NS }.freeze
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
Instance Method Summary collapse
-
#initialize(context:) ⇒ Parser
constructor
A new instance of Parser.
-
#parse(signature_element) ⇒ Object
signature_element: a Moxml::Element whose name is Signature in the xmldsig# namespace.
Constructor Details
#initialize(context:) ⇒ Parser
Returns a new instance of Parser.
15 16 17 |
# File 'lib/moxml/signature/parser.rb', line 15 def initialize(context:) @context = context end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
13 14 15 |
# File 'lib/moxml/signature/parser.rb', line 13 def context @context end |
Instance Method Details
#parse(signature_element) ⇒ Object
signature_element: a Moxml::Element whose name is Signature in the
xmldsig# namespace.
21 22 23 24 25 26 27 28 29 |
# File 'lib/moxml/signature/parser.rb', line 21 def parse(signature_element) Model::Signature.new( id: signature_element["Id"], signed_info: parse_signed_info(at_child(signature_element, "SignedInfo")), signature_value: parse_signature_value(at_child(signature_element, "SignatureValue")), key_info: parse_key_info(at_child(signature_element, "KeyInfo")), objects: [], ) end |