class OmniAuth::Strategies::Seb::Response
Constants
- SIGNED_KEYS
Public Instance Methods
prepend_length(value)
click to toggle source
# File lib/omniauth/strategies/seb/response.rb, line 16 def prepend_length(value) # prepend length to string in 0xx format [ value.to_s.length.to_s.rjust(3, '0'), value.dup.to_s.force_encoding('ascii')].join end
validate!(pub_key)
click to toggle source
# File lib/omniauth/strategies/seb/response.rb, line 21 def validate!(pub_key) raw_str = SIGNED_KEYS.map{|k| prepend_length(@hash[k])}.join received_sig_str = Base64.decode64(@hash['IB_CRC']) if !pub_key.verify(OpenSSL::Digest::SHA1.new, received_sig_str, raw_str) raise ValidationError, 'Invalid signature' end self end