graphenestorage.base module

class graphenestorage.base.InRamConfigurationStore(*args, **kwargs)

Bases: graphenestorage.ram.InRamStore, graphenestorage.interfaces.ConfigInterface

A simple example that stores configuration in RAM.

Internally, this works by simply inheriting graphenestorage.ram.InRamStore. The interface is defined in graphenestorage.interfaces.ConfigInterface.

class graphenestorage.base.InRamEncryptedKeyStore(*args, **kwargs)

Bases: graphenestorage.ram.InRamStore, graphenestorage.base.KeyEncryption

An in-RAM Store that stores keys encrypted in RAM.

Internally, this works by simply inheriting graphenestorage.ram.InRamStore. The interface is defined in graphenestorage.interfaces.KeyInterface.

Note

This module also inherits graphenestorage.masterpassword.MasterPassword which offers additional methods and deals with encrypting the keys.

class graphenestorage.base.InRamPlainKeyStore(*args, **kwargs)

Bases: graphenestorage.ram.InRamStore, graphenestorage.interfaces.KeyInterface

A simple in-RAM Store that stores keys unencrypted in RAM

Internally, this works by simply inheriting graphenestorage.ram.InRamStore. The interface is defined in graphenestorage.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.EncryptedKeyInterface

This 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.ConfigInterface

This 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 in graphenestorage.interfaces.ConfigInterface.

class graphenestorage.base.SqliteEncryptedKeyStore(*args, **kwargs)

Bases: graphenestorage.sqlite.SQLiteStore, graphenestorage.base.KeyEncryption

This 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 in graphenestorage.interfaces.KeyInterface.

Note

This module also inherits graphenestorage.masterpassword.MasterPassword which offers additional methods and deals with encrypting the keys.

class graphenestorage.base.SqlitePlainKeyStore(*args, **kwargs)

Bases: graphenestorage.sqlite.SQLiteStore, graphenestorage.interfaces.KeyInterface

This 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 in graphenestorage.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