lib/xml/kit/signature.rb in xml-kit-0.2.0 vs lib/xml/kit/signature.rb in xml-kit-0.3.0
- old
+ new
@@ -1,9 +1,13 @@
# frozen_string_literal: true
module Xml
module Kit
+ # An implementation of the Signature element.
+ # https://www.w3.org/TR/xmldsig-core1/#sec-Signature
+ #
+ # @since 0.1.0
class Signature
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',
@@ -21,10 +25,15 @@
attr_reader :certificate
attr_reader :digest_method
attr_reader :reference_id
attr_reader :signature_method
- def initialize(reference_id, signature_method: :SH256, digest_method: :SHA256, certificate:)
+ 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