How to use the nucypher.config.characters.AliceConfiguration function in nucypher

To help you get started, we’ve selected a few nucypher examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github drbh / ncipfs / ncipfs.py View on Github external
def act_as_alice(self, name, password):
        dirname = "accounts/" + name + "/"
        congifloc = dirname + "alice.config"
        alice_config = AliceConfiguration(
            config_root=os.path.join(dirname),
            is_me=True, 
            known_nodes={self.ursula}, 
            start_learning_now=False,
            federated_only=True, 
            learn_on_same_thread=True,
        )
        
        cfg = alice_config.from_configuration_file(congifloc)
        cfg.keyring.unlock(password)
        alice = cfg.produce()
#         alice.start_learning_loop(now=True)
        return alice
github drbh / ncipfs / ncipfs.py View on Github external
def create_new_user(self, name, password):
        passphrase = password
        direco = "accounts/"+ name
#         alice_config = AliceConfiguration(
#             config_root=os.path.join(direco),
#             is_me=True, known_nodes={self.ursula}, start_learning_now=True,
#             federated_only=True, learn_on_same_thread=True,
#         )
#         alice_config.initialize(password=passphrase)
#         alice_config.keyring.unlock(password=passphrase)
#         alice_config_file = alice_config.to_configuration_file()
        alice_config = AliceConfiguration(
            config_root=os.path.join(direco),
            is_me=True,
            known_nodes={self.ursula},
            start_learning_now=False,
            federated_only=True,
            learn_on_same_thread=True,
        )
        alice_config.initialize(password=passphrase)
        alice_config.keyring.unlock(password=passphrase)
        alice = alice_config.produce()
        alice_config_file = alice_config.to_configuration_file()
        alice.start_learning_loop(now=True)

        
        enc_privkey = UmbralPrivateKey.gen_key()
        sig_privkey = UmbralPrivateKey.gen_key()