Class: OAuth::Signature::HMAC::SHA1

Inherits:
Base
  • Object
show all
Defined in:
lib/oauth/signature/hmac/sha1.rb

Instance Attribute Summary

Attributes inherited from Base

#consumer_secret, #options, #request, #token_secret

Instance Method Summary collapse

Methods inherited from Base

#==, digest_class, implements, #initialize, #signature, #signature_base_string, #verify

Methods included from Helper

#escape, #generate_key, #generate_timestamp, #normalize, #parse_header, #unescape

Constructor Details

This class inherits a constructor from OAuth::Signature::Base

Instance Method Details

#digestObject



14
15
16
17
18
19
20
# File 'lib/oauth/signature/hmac/sha1.rb', line 14

def digest
  if RUBY_VERSION >= "1.9"
    Digest::HMAC.new(secret, Digest::SHA1).digest(signature_base_string)
  else
    ::HMAC::SHA1.digest(secret, signature_base_string)
  end
end