Пример #1
0
def main_key_id():
    try:
        k = Key()
        nk = k.fromFile(main_priv_enc_key_path)
        if not nk.id or not str(nk.id).isdigit() or int(nk.id) == 0:
            log.error("main_key_id(): bad key id: '%s'" % ( str(nk.id) ) )
            raise xmlrpclib.Fault(105, "Bad server activation.")
        return int(nk.id)

    except Exception, e:
        log.error("main_key_id(): exception: '%s'" % ( str(e) ) )
        raise xmlrpclib.Fault(105, "Bad server activation.")
Пример #2
0
 def get_enc_pkey(self):
     """Return the public encryption key or None."""
     if os.path.exists(self._enc_pkey_path):
         return Key.fromFile(self._enc_pkey_path)
     else:
         return None
Пример #3
0
 def get_sig_pkey(self):
     """Return the public signature key or None."""
     if os.path.exists(self._sig_pkey_path):
         return Key.fromFile(self._sig_pkey_path)
     else:
         return None