#NEWLINE# def callStore( self , nodeToAsk , key , value ) : #NEWLINE# #INDENT# "\n        Sends a request for 'nodeToAsk' to store value 'value' with key 'key'\n        " #NEWLINE# address = ( nodeToAsk . ip , nodeToAsk . port ) #NEWLINE# challenge = generate_challenge ( ) #NEWLINE# try : #NEWLINE# #INDENT# private = OpenSSL . crypto . load_privatekey ( OpenSSL . crypto . FILETYPE_PEM , self . priv_key , '' ) #NEWLINE# signature = OpenSSL . crypto . sign ( private , ( nodeToAsk . id . encode ( 'hex' ) . upper ( ) + challenge ) , 'sha256' ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# logger ( self . sourceNode , 'RETNONE: Signing of store failed' ) #NEWLINE# return None #NEWLINE# #UNINDENT# d = self . store ( address , self . sourceNode . id , key , value , challenge , signature ) #NEWLINE# logger ( self . sourceNode , 'callStore initiated' ) #NEWLINE# return d . addCallback ( self . handleSignedStoreResponse , nodeToAsk , challenge )