def getIdentityKeyPair(self):
        query = '''SELECT public_key as "public_key [pk]", private_key
                   FROM secret LIMIT 1'''
        result = self._con.execute(query).fetchone()

        return IdentityKeyPair(result.public_key,
                               DjbECPrivateKey(result.private_key))
Beispiel #2
0
    def getIdentityKeyPair(self):
        q = "SELECT public_key, private_key FROM identities WHERE recipient_id = -1"
        c = self.dbConn.cursor()
        c.execute(q)
        result = c.fetchone()

        publicKey, privateKey = result
        return IdentityKeyPair(IdentityKey(DjbECPublicKey(publicKey[1:])), DjbECPrivateKey(privateKey))
Beispiel #3
0
 def getIdentityKeyPair(self):
     q = "SELECT public_key, private_key FROM {}_identities WHERE recipient_id = -1".format(
         self.phoneNumber)
     dbConn = self.get_conn()
     c = dbConn.cursor()
     c.execute(q)
     result = c.fetchone()
     dbConn.close()
     publicKey, privateKey = result
     return IdentityKeyPair(IdentityKey(DjbECPublicKey(publicKey[1:])),
                            DjbECPrivateKey(privateKey))