merge seattle work

This commit is contained in:
Kevin F 2022-11-27 01:03:44 +00:00
parent 30d50ceacf
commit bc3d6571bb
2 changed files with 32 additions and 0 deletions

View File

@ -0,0 +1,31 @@
import base64
import keyring.errors
from nacl.signing import SigningKey
from logger import log as logging
import config
from wot import wotkeyring
from wot.identity import Identity
def create_new_iden():
iden = Identity(
SigningKey.generate(),
input('Enter a name for your identity: '))
try:
wotkeyring.set_identity(iden)
except keyring.errors.NoKeyringError:
logging.warn(
"Could not use secure keyring to store your WOT " +
"private key, using config.")
logging.info("Using config file to store identity private key")
config.set(
'wot.identity.{iden.name}',
base64.b85encode(
bytes(iden.private_key)).decode('utf-8'), savefile=True)
config.set(
'wot.active_identity_name', iden.name, savefile=True)
logging.info(
'Identity created and automatically set as active. ' +
'Restart Onionr to use it.')

View File

@ -0,0 +1 @@
def trust_identity():