Beispiel #1
0
 def setKeyServer(self, keyServerAddr, keyServerPublic):
     """
     Sets the public key for the key server
     """
     self.keyServerAddr = keyServerAddr
     self.keyServerPublic = crypto.load(keyServerPublic)
     return self.addKey(self.keyServerPublic, self.keyServerAddr)
Beispiel #2
0
 def setPrivate(self, privateKey):
     """
     Sets the private key and extracts the public keys
     """
     self.privateKey = crypto.load(privateKey)
     self.publicKey = crypto.publicKey(self.privateKey)
     self.publicKeyText = crypto.publicKey(self.privateKey, text=True)
     return self.privateKey
Beispiel #3
0
 def getKey(self, host=HOST, port=PORT):
     """
     Requests and loads the servers public key
     """
     # Ask for the servers public key
     reply, error = self.call("key", host, port, {}, NO_ENCRYPT)
     # Load the public key
     self.publicKey = crypto.load(reply)
     return self.publicKey, error
Beispiel #4
0
 def requestKey(self, keyRingKey):
     if self.keyServerAddr != False:
         # Ask the server for the key
         publicKey, status = self.call("keyServerGetKey", keyRingKey, self.keyServerAddr)
         return crypto.load(publicKey)
     return False