merge seattle work
This commit is contained in:
parent
30d50ceacf
commit
bc3d6571bb
31
static-data/official-plugins/wot/cli/createiden.py
Normal file
31
static-data/official-plugins/wot/cli/createiden.py
Normal 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.')
|
1
static-data/official-plugins/wot/cli/trustidentity.py
Normal file
1
static-data/official-plugins/wot/cli/trustidentity.py
Normal file
@ -0,0 +1 @@
|
|||||||
|
def trust_identity():
|
Loading…
Reference in New Issue
Block a user