Sha256: da9069af9e5d251538559b204a340c9ecbb6a217f1a214defc6565b3ed072915

Contents?: true

Size: 479 Bytes

Versions: 1

Compression:

Stored size: 479 Bytes

Contents

require 'openssl'

module SignedXml
  module DigestMethodResolution
    include OpenSSL

    def new_digester_for_id(id)

      id = id && id =~ /sha(.*?)$/i && $1.to_i
      case id
      when 256 then OpenSSL::Digest::SHA256.new
      when 384 then OpenSSL::Digest::SHA384.new
      when 512 then OpenSSL::Digest::SHA512.new        
      when 1   then OpenSSL::Digest::SHA1.new
      else
        raise ArgumentError, "unknown digest method #{id}"
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
omniauth-islykill-1.0.0 lib/signed_xml/digest_method_resolution.rb