Module: SignedXml::DigestMethodResolution
- Includes:
- OpenSSL
- Included in:
- DigestTransform, Signature
- Defined in:
- lib/signed_xml/digest_method_resolution.rb
Instance Method Summary collapse
Instance Method Details
#new_digester_for_id(id) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/signed_xml/digest_method_resolution.rb', line 7 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 |