def generate_keys(params: GroupParams, seed=None) -> (str, str, str):
     seed = IndyCryptoBlsUtils.prepare_seed(seed)
     gen = IndyCryptoBlsUtils.bls_from_str(params.g, Generator)
     sk = SignKey.new(seed)
     vk = VerKey.new(gen, sk)
     key_proof = ProofOfPossession.new(ver_key=vk, sign_key=sk)
     sk_str = IndyCryptoBlsUtils.bls_to_str(sk)
     vk_str = IndyCryptoBlsUtils.bls_to_str(vk)
     key_proof_str = IndyCryptoBlsUtils.bls_to_str(key_proof)
     return sk_str, vk_str, key_proof_str
Esempio n. 2
0
def ver_key2(generator: Generator, sign_key2: SignKey) -> VerKey:
    ver_key = VerKey.new(generator, sign_key2)

    assert type(ver_key) is VerKey
    assert ver_key.c_instance is not None
    return ver_key
Esempio n. 3
0
def test_as_bytes(ver_key1: VerKey):
    xbytes = ver_key1.as_bytes()
    assert len(xbytes) > 0