graphenestorage.base module¶
-
class
graphenestorage.base.InRamConfigurationStore(*args, **kwargs)¶ Bases:
graphenestorage.ram.InRamStore,graphenestorage.interfaces.ConfigInterfaceA simple example that stores configuration in RAM.
Internally, this works by simply inheriting
graphenestorage.ram.InRamStore. The interface is defined ingraphenestorage.interfaces.ConfigInterface.
-
class
graphenestorage.base.InRamEncryptedKeyStore(*args, **kwargs)¶ Bases:
graphenestorage.ram.InRamStore,graphenestorage.base.KeyEncryptionAn in-RAM Store that stores keys encrypted in RAM.
Internally, this works by simply inheriting
graphenestorage.ram.InRamStore. The interface is defined ingraphenestorage.interfaces.KeyInterface.Note
This module also inherits
graphenestorage.masterpassword.MasterPasswordwhich offers additional methods and deals with encrypting the keys.
-
class
graphenestorage.base.InRamPlainKeyStore(*args, **kwargs)¶ Bases:
graphenestorage.ram.InRamStore,graphenestorage.interfaces.KeyInterfaceA simple in-RAM Store that stores keys unencrypted in RAM
Internally, this works by simply inheriting
graphenestorage.ram.InRamStore. The interface is defined ingraphenestorage.interfaces.KeyInterface.-
add(wif, pub)¶ - Add a new public/private key pair (correspondence has to be
- checked elsewhere!)
Parameters: - pub (str) – Public key
- wif (str) – Private key
-
delete(pub)¶ Delete a key from the store
-
getPrivateKeyForPublicKey(pub)¶ - Returns the (possibly encrypted) private key that
- corresponds to a public key
Parameters: pub (str) – Public key The encryption scheme is BIP38
-
getPublicKeys()¶ Returns the public keys stored in the database
-
-
class
graphenestorage.base.KeyEncryption(*args, **kwargs)¶ Bases:
graphenestorage.masterpassword.MasterPassword,graphenestorage.interfaces.EncryptedKeyInterfaceThis is an interface class that provides the methods required for EncryptedKeyInterface and links them to the MasterPassword-provided functionatlity, accordingly.
-
add(wif, pub)¶ - Add a new public/private key pair (correspondence has to be
- checked elsewhere!)
Parameters: - pub (str) – Public key
- wif (str) – Private key
-
getPrivateKeyForPublicKey(pub)¶ - Returns the (possibly encrypted) private key that
- corresponds to a public key
Parameters: pub (str) – Public key The encryption scheme is BIP38
-
getPublicKeys()¶ Returns the public keys stored in the database
-
is_encrypted()¶ Returns True/False to indicate required use of unlock
-
-
class
graphenestorage.base.SqliteConfigurationStore(*args, **kwargs)¶ Bases:
graphenestorage.sqlite.SQLiteStore,graphenestorage.interfaces.ConfigInterfaceThis is the configuration storage that stores key/value pairs in the config table of the SQLite3 database.
Internally, this works by simply inheriting
graphenestorage.sqlite.SQLiteStore. The interface is defined ingraphenestorage.interfaces.ConfigInterface.
-
class
graphenestorage.base.SqliteEncryptedKeyStore(*args, **kwargs)¶ Bases:
graphenestorage.sqlite.SQLiteStore,graphenestorage.base.KeyEncryptionThis is the key storage that stores the public key and the encrypted private key in the keys table in the SQLite3 database.
Internally, this works by simply inheriting
graphenestorage.ram.InRamStore. The interface is defined ingraphenestorage.interfaces.KeyInterface.Note
This module also inherits
graphenestorage.masterpassword.MasterPasswordwhich offers additional methods and deals with encrypting the keys.
-
class
graphenestorage.base.SqlitePlainKeyStore(*args, **kwargs)¶ Bases:
graphenestorage.sqlite.SQLiteStore,graphenestorage.interfaces.KeyInterfaceThis is the key storage that stores the public key and the unencrypted private key in the keys table in the SQLite3 database.
Internally, this works by simply inheriting
graphenestorage.ram.InRamStore. The interface is defined ingraphenestorage.interfaces.KeyInterface.-
add(wif, pub)¶ - Add a new public/private key pair (correspondence has to be
- checked elsewhere!)
Parameters: - pub (str) – Public key
- wif (str) – Private key
-
delete(pub)¶ Delete a key from the store
Parameters: value (str) – Value
-
getPrivateKeyForPublicKey(pub)¶ - Returns the (possibly encrypted) private key that
- corresponds to a public key
Parameters: pub (str) – Public key The encryption scheme is BIP38
-
getPublicKeys()¶ Returns the public keys stored in the database
-
is_encrypted()¶ Returns False, as we are not encrypted here
-