Class: Xml::Kit::Signature
- Inherits:
-
Object
- Object
- Xml::Kit::Signature
- Defined in:
- lib/xml/kit/signature.rb
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
Returns the value of attribute certificate.
-
#digest_method ⇒ Object
readonly
Returns the value of attribute digest_method.
-
#reference_id ⇒ Object
readonly
Returns the value of attribute reference_id.
-
#signature_method ⇒ Object
readonly
Returns the value of attribute signature_method.
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.
26 27 28 29 30 31 |
# File 'lib/xml/kit/signature.rb', line 26 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)
Returns the value of attribute certificate.
21 22 23 |
# File 'lib/xml/kit/signature.rb', line 21 def certificate @certificate end |
#digest_method ⇒ Object (readonly)
Returns the value of attribute digest_method.
22 23 24 |
# File 'lib/xml/kit/signature.rb', line 22 def digest_method @digest_method end |
#reference_id ⇒ Object (readonly)
Returns the value of attribute reference_id.
23 24 25 |
# File 'lib/xml/kit/signature.rb', line 23 def reference_id @reference_id end |
#signature_method ⇒ Object (readonly)
Returns the value of attribute signature_method.
24 25 26 |
# File 'lib/xml/kit/signature.rb', line 24 def signature_method @signature_method end |