Class: Ramazon::Signatory

Inherits:
Object
  • Object
show all
Defined in:
lib/ramazon/signatory.rb

Class Method Summary collapse

Class Method Details

.sign(string_to_sign) ⇒ Object



3
4
5
6
7
8
# File 'lib/ramazon/signatory.rb', line 3

def self.sign(string_to_sign)
  sha1 = HMAC::SHA256.digest(Ramazon::Configuration.secret_key, string_to_sign)

  #Base64 encoding adds a linefeed to the end of the string so chop the last character!
  CGI.escape(Base64.encode64(sha1).chomp)
end