#NEWLINE# def _check_signature( self , request , consumer , token ) : #NEWLINE# #INDENT# ( timestamp , nonce ) = request . _get_timestamp_nonce ( ) #NEWLINE# self . _check_timestamp ( timestamp ) #NEWLINE# signature_method = self . _get_signature_method ( request ) #NEWLINE# try : #NEWLINE# #INDENT# signature = request . get_parameter ( 'oauth_signature' ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# raise MissingSignature ( 'Missing oauth_signature.' ) #NEWLINE# #UNINDENT# valid = signature_method . check ( request , consumer , token , signature ) #NEWLINE# if ( not valid ) : #NEWLINE# #INDENT# ( key , base ) = signature_method . signing_base ( request , consumer , token ) #NEWLINE# raise Error ( ( 'Invalid signature. Expected signature base string: %s' % base ) ) #NEWLINE# #UNINDENT# built = signature_method . sign ( request , consumer , token )