7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
# File 'lib/signet/oauth_1/signature_methods/hmac_sha1.rb', line 7
def self.generate_signature \
base_string, client_credential_secret, token_credential_secret
client_credential_secret =
Signet::OAuth1.encode client_credential_secret
token_credential_secret =
Signet::OAuth1.encode token_credential_secret
key = [client_credential_secret, token_credential_secret].join "&"
Base64.encode64(OpenSSL::HMAC.digest(
OpenSSL::Digest.new("sha1"), key, base_string
)).strip
end
|