Class: Xml::Kit::Signature
- Inherits:
-
Object
- Object
- Xml::Kit::Signature
- Defined in:
- lib/xml/kit/signature.rb
Overview
An implementation of the Signature element. www.w3.org/TR/xmldsig-core1/#sec-Signature
Constant Summary collapse
- SIGNATURE_METHODS =
{ SHA1: 'http://www.w3.org/2000/09/xmldsig#rsa-sha1', SHA224: 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha224', SHA256: 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha256', SHA384: 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha384', SHA512: 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha512', }.freeze
- DIGEST_METHODS =
{ SHA1: 'http://www.w3.org/2000/09/xmldsig#sha1', SHA224: 'http://www.w3.org/2001/04/xmldsig-more#sha224', SHA256: 'http://www.w3.org/2001/04/xmlenc#sha256', SHA384: 'http://www.w3.org/2001/04/xmldsig-more#sha384', SHA512: 'http://www.w3.org/2001/04/xmlenc#sha512', }.freeze
Instance Attribute Summary collapse
- #certificate ⇒ Object readonly
- #digest_method ⇒ Object readonly
- #reference_id ⇒ Object readonly
- #signature_method ⇒ Object readonly
Instance Method Summary collapse
-
#initialize(reference_id, signature_method: :SH256, digest_method: :SHA256, certificate:) ⇒ Signature
constructor
A new instance of Signature.
- #to_xml(xml: ::Builder::XmlMarkup.new) ⇒ Object
Constructor Details
#initialize(reference_id, signature_method: :SH256, digest_method: :SHA256, certificate:) ⇒ Signature
Returns a new instance of Signature.
30 31 32 33 34 35 36 37 38 |
# File 'lib/xml/kit/signature.rb', line 30 def initialize(reference_id, signature_method: :SH256, digest_method: :SHA256, certificate:) @certificate = certificate @digest_method = DIGEST_METHODS[digest_method] @reference_id = reference_id @signature_method = SIGNATURE_METHODS[signature_method] end |
Instance Attribute Details
#certificate ⇒ Object (readonly)
25 26 27 |
# File 'lib/xml/kit/signature.rb', line 25 def certificate @certificate end |
#digest_method ⇒ Object (readonly)
26 27 28 |
# File 'lib/xml/kit/signature.rb', line 26 def digest_method @digest_method end |
#reference_id ⇒ Object (readonly)
27 28 29 |
# File 'lib/xml/kit/signature.rb', line 27 def reference_id @reference_id end |
#signature_method ⇒ Object (readonly)
28 29 30 |
# File 'lib/xml/kit/signature.rb', line 28 def signature_method @signature_method end |