Class: Linkscape::Signer
- Inherits:
-
Object
- Object
- Linkscape::Signer
- Defined in:
- lib/linkscape/signer.rb
Class Method Summary collapse
Class Method Details
.signParams(params, keysToSign = [:accessID, :expiration], key = nil) ⇒ Object
4 5 6 7 8 9 10 |
# File 'lib/linkscape/signer.rb', line 4 def self.signParams params, keysToSign=[:accessID, :expiration], key = nil params[:expiration] ||= Time.now.to_i + 60 stringToSign = keysToSign.collect{|k| params[k].to_s}.join("\n") key ||= params[:secretKey] signature = CGI::escape( Base64.encode64( HMAC::SHA1.digest( key, stringToSign ) ).chomp ) params[:signature] = signature end |