Class: Qiniu::AccessToken
- Inherits:
-
Object
- Object
- Qiniu::AccessToken
- Includes:
- Utils
- Defined in:
- lib/qiniu/tokens/access_token.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#access_key ⇒ Object
Returns the value of attribute access_key.
-
#secret_key ⇒ Object
Returns the value of attribute secret_key.
Instance Method Summary collapse
Methods included from Utils
#crc32checksum, #debug, #encode_entry_uri, #http_request, #safe_json_parse, #send_request_with, #urlsafe_base64_decode, #urlsafe_base64_encode
Instance Attribute Details
#access_key ⇒ Object
Returns the value of attribute access_key.
14 15 16 |
# File 'lib/qiniu/tokens/access_token.rb', line 14 def access_key @access_key end |
#secret_key ⇒ Object
Returns the value of attribute secret_key.
14 15 16 |
# File 'lib/qiniu/tokens/access_token.rb', line 14 def secret_key @secret_key end |
Instance Method Details
#generate_encoded_digest(signature) ⇒ Object
16 17 18 19 20 |
# File 'lib/qiniu/tokens/access_token.rb', line 16 def generate_encoded_digest(signature) hmac = HMAC::SHA1.new(@secret_key) hmac.update(signature) urlsafe_base64_encode(hmac.digest) end |