#NEWLINE# def verify( self , key_file = '' ) : #NEWLINE# #INDENT# ' Verify that the assertion is syntactically correct and\n        the signature is correct if present.\n        :param key_file: If not the default key file should be used this is it.\n        ' #NEWLINE# try : #NEWLINE# #INDENT# res = self . _verify ( ) #NEWLINE# #UNINDENT# except AssertionError as err : #NEWLINE# #INDENT# logger . error ( ( 'Verification error on the response: %s' % err ) ) #NEWLINE# raise #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( res is None ) : #NEWLINE# #INDENT# return None #NEWLINE# #UNINDENT# #UNINDENT# if ( not isinstance ( self . response , samlp . Response ) ) : #NEWLINE# #INDENT# return self #NEWLINE# #UNINDENT# if self . parse_assertion ( key_file ) : #NEWLINE# #INDENT# return self #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# logger . error ( 'Could not parse the assertion' ) #NEWLINE# return None