def generate_cs_keypair(keypair_filename = None, pubkey_filename = None): keypair = permid.generate_keypair() if keypair_filename: permid.save_keypair(keypair, keypair_filename) pubkey = encodestring(str(keypair.pub().get_der())).replace('\n', '') if pubkey_filename: permid.save_pub_key(keypair, pubkey_filename) return (keypair, pubkey)
def generate_cs_keypair(keypair_filename=None, pubkey_filename=None): keypair = permid.generate_keypair() if keypair_filename: permid.save_keypair(keypair, keypair_filename) pubkey = encodestring(str(keypair.pub().get_der())).replace('\n', '') if pubkey_filename: permid.save_pub_key(keypair, pubkey_filename) return (keypair, pubkey)
def __init__(self, keypair = None): LiveSourceAuthConfig.__init__(self, LIVE_AUTHMETHOD_ECDSA) if keypair is None: self.keypair = permidmod.generate_keypair() else: self.keypair = keypair