Sha256: 144a775ece0ea20309e744947ce636ac424896137fa699507cb18d0d40365fd8

Contents?: true

Size: 534 Bytes

Versions: 10

Compression:

Stored size: 534 Bytes

Contents

module Saml
  module Kit
    class Signature
      def initialize(xml_hash)
        @xml_hash = xml_hash
      end

      def certificate
        value = to_h.fetch('KeyInfo', {}).fetch('X509Data', {}).fetch('X509Certificate', nil)
        return if value.nil?
        Saml::Kit::Certificate.new(value, use: :signing)
      end

      def trusted?(metadata)
        return false if metadata.nil?
        metadata.matches?(certificate.fingerprint, use: :signing)
      end

      def to_h
        @xml_hash
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
saml-kit-0.2.14 lib/saml/kit/signature.rb
saml-kit-0.2.13 lib/saml/kit/signature.rb
saml-kit-0.2.12 lib/saml/kit/signature.rb
saml-kit-0.2.11 lib/saml/kit/signature.rb
saml-kit-0.2.10 lib/saml/kit/signature.rb
saml-kit-0.2.9 lib/saml/kit/signature.rb
saml-kit-0.2.8 lib/saml/kit/signature.rb
saml-kit-0.2.7 lib/saml/kit/signature.rb
saml-kit-0.2.6 lib/saml/kit/signature.rb
saml-kit-0.2.5 lib/saml/kit/signature.rb