Class: OAuth::Signature::HMAC::SHA2

Inherits:
Base
  • Object
show all
Defined in:
lib/oauth/signature/hmac/sha2.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



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

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