예제 #1
0
 def check_cb(rows, *args, **kw):
     logging.debug("IndxUser, get_keys, connected_cb, check_cb")
     if len(rows) < 1:
         return_d.callback(None)
         return
     
     try:
         return_d.callback({"public": load_key(rows[0][0]), "private": load_key(rows[0][1])})
     except Exception as e:
         logging.error("IndxUser, get_keys, Exception loading keys from database: {0}".format(e))
         return_d.errback(Failure(e))
예제 #2
0
파일: user.py 프로젝트: imclab/indx
 def check_cb(rows, *args, **kw):
     logging.debug("IndxUser, get_keys, connected_cb, check_cb")
     if len(rows) < 1:
         return_d.callback(None)
         return
     
     try:
         return_d.callback({"public": load_key(rows[0][0]), "private": load_key(rows[0][1])})
     except Exception as e:
         logging.error("IndxUser, get_keys, Exception loading keys from database: {0}".format(e))
         return_d.errback(Failure(e))
예제 #3
0
파일: keystore.py 프로젝트: imclab/indx
        def queried_cb(rows):
            if len(rows) != 1:
                return_d.callback(None) # no key, return nothing
                return

            public_hash, public_key, private_key, username, boxid = rows[0]

            if private_key is None or private_key == '':
                key = {"public-hash": public_hash, "public": load_key(public_key), "private": ""}
            else:
                key = {"public-hash": public_hash, "public": load_key(public_key), "private": load_key(private_key)}

            return_d.callback({"username": username, "box": boxid, "key": key})
예제 #4
0
파일: keystore.py 프로젝트: kyonetca/indx
        def queried_cb(rows):
            if len(rows) != 1:
                return_d.callback(None)  # no key, return nothing
                return

            public_hash, public_key, private_key, username, boxid = rows[0]

            if private_key is None or private_key == '':
                key = {
                    "public-hash": public_hash,
                    "public": load_key(public_key),
                    "private": ""
                }
            else:
                key = {
                    "public-hash": public_hash,
                    "public": load_key(public_key),
                    "private": load_key(private_key)
                }

            return_d.callback({"username": username, "box": boxid, "key": key})