def generate_signed_message(method, headers_dict, body_dict, access_key, secret_key):
 message = signing_format_message(method, headers_dict, body_dict)
 hashed = hmac.new(secret_key.encode('utf-8'), message, sha256)
 signature = binascii.b2a_base64(hashed.digest()).rstrip('\n')
 authorization_header = 'SSI {}:{}'.format(access_key, signature)
 message += '\n'
 return (message, signature, authorization_header)

def generate_signed_message ( method , headers_dict , body_dict , access_key , secret_key ) : message = signing_format_message ( method , headers_dict , body_dict ) hashed = hmac . new ( secret_key . encode ( 'utf-8' ) , message , sha256 ) signature = binascii . b2a_base64 ( hashed . digest ( ) ) . rstrip ( '\n' ) authorization_header = 'SSI {}:{}' . format ( access_key , signature ) message += '\n' return ( message , signature , authorization_header )
returns a pair .