'Signature = base64(hmac-sha1(AccessKeySecret,
VERB + "
+ CONTENT-MD5 + "
+ CONTENT-TYPE + "
+ EXPIRES + "
+ CanonicalizedOSSHeaders
+ CanonicalizedResource))'

@staticmethod
def _get_auth_signature(method, headers, params, expires, secret_key, path, vendor_prefix):

    special_headers = {'content-md5': '', 'content-type': '', 'expires': ''}
    vendor_headers = {}
    for (key, value) in list(headers.items()):
        key_lower = key.lower()
        if (key_lower in special_headers):
            special_headers[key_lower] = value.strip()
        elif key_lower.startswith(vendor_prefix):
            vendor_headers[key_lower] = value.strip()
    if expires:
        special_headers['expires'] = str(expires)
    buf = [method]
    for (_, value) in sorted(special_headers.items()):
        buf.append(value)
    string_to_sign = '\n'.join(buf)
    buf = []
    for (key, value) in sorted(vendor_headers.items()):
        buf.append(('%s:%s' % (key, value)))
    header_string = '\n'.join(buf)
    values_to_sign = []
    for value in [string_to_sign, header_string, path]:
        if value:
            values_to_sign.append(value)
    string_to_sign = '\n'.join(values_to_sign)
    b64_hmac = base64.b64encode(hmac.new(b(secret_key), b(string_to_sign), digestmod=sha1).digest())
    return b64_hmac
