Sha256: a62984edcb3f98fe7c088539c2c823d69284df924f2fd0f092fb7ca12594ed03

Contents?: true

Size: 1.33 KB

Versions: 6

Compression:

Stored size: 1.33 KB

Contents

module Saml
  module Kit
    module Builders
      class XmlSignature
        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

        attr_reader :embed_signature, :configuration
        attr_reader :reference_id
        attr_reader :certificate

        def initialize(reference_id, configuration:, certificate: )
          @configuration = configuration
          @reference_id = reference_id
          @certificate = certificate
        end

        def signature_method
          SIGNATURE_METHODS[configuration.signature_method]
        end

        def digest_method
          DIGEST_METHODS[configuration.digest_method]
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
saml-kit-0.3.0 lib/saml/kit/builders/xml_signature.rb
saml-kit-0.2.18 lib/saml/kit/builders/xml_signature.rb
saml-kit-0.2.17 lib/saml/kit/builders/xml_signature.rb
saml-kit-0.2.16 lib/saml/kit/builders/xml_signature.rb
saml-kit-0.2.15 lib/saml/kit/builders/xml_signature.rb
saml-kit-0.2.14 lib/saml/kit/builders/xml_signature.rb