Commits

pjs  committed 0dc9986

[svn r22] Completed secures3.py

  • Participants
  • Parent commits 5d3e465
  • Branches trunk

Comments (0)

Files changed (1)

File aws/secures3.py

 class SecureS3(object):
     def __init__(self, key, secret_key):
         self.key = key
-        self.secret_key = key
+        self.secret_key = secret_key
 
     def gen_signature(self, string_to_sign):
         return base64.encodestring(
         else:
             expire_time = time.mktime(time.gmtime()) + expires
 
-        string_to_sign = u'GET\n\n\n%.0f\n%s' % (expire_time, path)
+        expire_str = '%.0f' % (expire_time)
+        string_to_sign = u'GET\n\n\n%s\n%s' % (expire_str, path)
         params = {
             'AWSAccessKeyId': self.key,
-            'Expires': '%.0f' % (expire_time),
+            'Expires': expire_str,
             'Signature': self.gen_signature(string_to_sign.encode('utf-8')),
         }