Class: XmlSig::Signature
- Inherits:
-
Object
- Object
- XmlSig::Signature
- Defined in:
- lib/xml_sig/signature.rb
Overview
An XML signature.
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#key_info ⇒ Object
Returns the value of attribute key_info.
-
#signature_value ⇒ Object
Returns the value of attribute signature_value.
-
#signed_info ⇒ Object
Returns the value of attribute signed_info.
Instance Method Summary collapse
- #assert ⇒ Object
- #objects ⇒ Object
-
#to_xml(xml = Builder::XmlMarkup.new) ⇒ Object
Construct an XML fragment representing the signature.
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
4 5 6 |
# File 'lib/xml_sig/signature.rb', line 4 def id @id end |
#key_info ⇒ Object
Returns the value of attribute key_info.
7 8 9 |
# File 'lib/xml_sig/signature.rb', line 7 def key_info @key_info end |
#signature_value ⇒ Object
Returns the value of attribute signature_value.
6 7 8 |
# File 'lib/xml_sig/signature.rb', line 6 def signature_value @signature_value end |
#signed_info ⇒ Object
Returns the value of attribute signed_info.
5 6 7 |
# File 'lib/xml_sig/signature.rb', line 5 def signed_info @signed_info end |
Instance Method Details
#assert ⇒ Object
13 14 15 |
# File 'lib/xml_sig/signature.rb', line 13 def assert # raise AssertionError, "An assertion signature must be valid" end |
#objects ⇒ Object
9 10 11 |
# File 'lib/xml_sig/signature.rb', line 9 def objects @objects ||= [] end |
#to_xml(xml = Builder::XmlMarkup.new) ⇒ Object
Construct an XML fragment representing the signature
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/xml_sig/signature.rb', line 18 def to_xml(xml=Builder::XmlMarkup.new) attributes = {} attributes['Id'] = id unless id.nil? attributes['xmlns:ds'] = "http://www.w3.org/2000/09/xmldsig#" xml.tag!('ds:Signature', attributes) { xml << signed_info.to_xml if signed_info xml.tag!('ds:SignatureValue') xml.tag!('ds:KeyInfo') if key_info } end |