def test_generate_key_using_seed(self):
        crypto = VirgilCrypto()
        seed = crypto.generate_random_data(32)

        key_id = crypto.generate_key_pair(seed=seed).private_key.identifier

        retries = 5
        while retries > 0:
            key_pair = crypto.generate_key_pair(seed=seed)
            self.assertTrue(key_id, key_pair.private_key.identifier)
            self.assertTrue(key_pair.private_key.identifier,
                            key_pair.public_key.identifier)
            retries -= 1
    def __check_generate_key_using_seed(self, key_pair_type):
        crypto = VirgilCrypto()
        seed = crypto.generate_random_data(32)

        key_id = crypto.generate_key_pair(key_pair_type,
                                          seed=seed).private_key.identifier

        retries = 5
        while retries > 0:
            key_pair = crypto.generate_key_pair(key_pair_type, seed=seed)
            self.assertTrue(key_id, key_pair.private_key.identifier)
            self.assertTrue(key_pair.private_key.identifier,
                            key_pair.public_key.identifier)
            self.assertEqual(key_pair.private_key.key_type, key_pair_type)
            retries -= 1