Class: OAuth::Signature::RSA::SHA1
- Defined in:
- lib/oauth/signature/rsa/sha1.rb
Instance Attribute Summary
Attributes inherited from Base
#consumer_secret, #options, #request, #token_secret
Instance Method Summary collapse
Methods inherited from Base
implements, #initialize, #signature, #signature_base_string, #verify
Methods included from Helper
#escape, #generate_key, #generate_timestamp, #normalize, #normalize_nested_query, #parse_header, #stringify_keys, #unescape
Constructor Details
This class inherits a constructor from OAuth::Signature::Base
Instance Method Details
#==(cmp_signature) ⇒ Object
7 8 9 |
# File 'lib/oauth/signature/rsa/sha1.rb', line 7 def ==(cmp_signature) public_key.verify(OpenSSL::Digest::SHA1.new, Base64.decode64(cmp_signature.is_a?(Array) ? cmp_signature.first : cmp_signature), signature_base_string) end |
#body_hash ⇒ Object
21 22 23 |
# File 'lib/oauth/signature/rsa/sha1.rb', line 21 def body_hash Base64.encode64(OpenSSL::Digest::SHA1.digest(request.body || '')).chomp.gsub(/\n/,'') end |