#NEWLINE# def GetAuthHeader( self , http_method , http_url ) : #NEWLINE# #INDENT# 'Generates the Authorization header.\n\n    The form of the secure AuthSub Authorization header is\n    Authorization: AuthSub token="token" sigalg="sigalg" data="data" sig="sig"\n    and  data represents a string in the form\n    data = http_method http_url timestamp nonce\n\n    Args:\n      http_method: string HTTP method i.e. operation e.g. GET, POST, PUT, etc.\n      http_url: string or atom.url.Url HTTP URL to which request is made.\n      \n    Returns:\n      dict Header to be sent with every subsequent request after authentication.\n    ' #NEWLINE# timestamp = int ( math . floor ( time . time ( ) ) ) #NEWLINE# nonce = ( '%lu' % random . randrange ( 1 , ( 2 ** 64 ) ) ) #NEWLINE# data = ( '%s %s %d %s' % ( http_method , str ( http_url ) , timestamp , nonce ) ) #NEWLINE# sig = cryptomath . bytesToBase64 ( self . rsa_key . hashAndSign ( data ) ) #NEWLINE# header = { #NEWLINE# #INDENT# 'Authorization' : ( '%s"%s" data="%s" sig="%s" sigalg="rsa-sha1"' % ( AUTHSUB_AUTH_LABEL , self . token_string , data , sig ) ) , #NEWLINE# #UNINDENT# } #NEWLINE# return header