#NEWLINE# def remote_verifyKey( self , key , protocol ) : #NEWLINE# #INDENT# ' Verify that the provided key matches the correct value. This method\n            can be called only once, after which an error is raised.\n\n            In case the key could be validated the protocol is registered with\n            the connection.\n\n            @param key:         Key which should be validated.\n            @type  key:         str\n\n            @param protocol:    Protocol who is responsible for the\n                                validation request and one partner of the\n                                new connection.\n            @type  protocol:    twisted.spread.pb.RemoteReference\n\n            @return:            None\n        ' #NEWLINE# if self . _authenticated . called : #NEWLINE# #INDENT# return Failure ( InvalidKey ( 'Only one guess is possible.' ) ) #NEWLINE# #UNINDENT# if isinstance ( protocol , Failure ) : #NEWLINE# #INDENT# self . _authenticated . errback ( protocol ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( self . _key != self ) : #NEWLINE# #INDENT# e = Failure ( InvalidKey ( 'Wrong key supplied.' ) ) #NEWLINE# self . _authenticated . errback ( e ) #NEWLINE# return e #NEWLINE# #UNINDENT# self . _authenticated . callback ( protocol )