funga/crypto_dev_signer/keystore/interface.py

31 lines
566 B
Python
Raw Normal View History

2020-09-21 19:10:20 +02:00
# standard imports
import os
# local imports
from . import keyapi
class Keystore:
def get(self, address, password=None):
raise NotImplementedError
2020-09-21 19:10:20 +02:00
def new(self, password=None):
2020-09-21 19:10:20 +02:00
b = os.urandom(32)
return self.import_raw_key(b, password)
def import_raw_key(self, b, password=None):
pk = keyapi.PrivateKey(b)
return self.import_key(pk, password)
2020-09-20 10:00:59 +02:00
def import_key(self, pk, password=None):
raise NotImplementedError
2020-09-21 19:10:20 +02:00
def insert_key(self, pk, password=None):
raise NotImplementedError