nectarstorage.base module

class nectarstorage.base.InRamConfigurationStore(*_args, **_kwargs)

Bases: InRamStore, ConfigInterface

A simple example that stores configuration in RAM.

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

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

Bases: InRamStore, KeyEncryption

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

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

Note

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

class nectarstorage.base.InRamEncryptedTokenStore(*args, **kwargs)

Bases: InRamStore, TokenEncryption

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

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

Note

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

class nectarstorage.base.InRamPlainKeyStore(*_args, **_kwargs)

Bases: InRamStore, KeyInterface

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

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

add(wif, pub=None)

Add a new public/private key pair (correspondence has to be checked elsewhere!)

Parameters:
  • pub (str) – Public key

  • wif (str) – Private key

delete(key)

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 nectarstorage.base.InRamPlainTokenStore(*_args, **_kwargs)

Bases: InRamStore, TokenInterface

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

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

add(token, name=None)

Add a new token entry (correspondence has to be checked elsewhere!)

Parameters:
  • name (str) – Public identifier

  • token (str) – Token value

delete(key)

Delete a key from the store

getPrivateKeyForPublicKey(pub)

Returns the (possibly encrypted) token that corresponds to a name

Parameters:

pub (str) – Public key

The encryption scheme is BIP38

getPublicNames()

Returns the public token names stored in the database

class nectarstorage.base.KeyEncryption(*args, **kwargs)

Bases: MasterPassword, 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=None)

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 nectarstorage.base.SqliteConfigurationStore(*args, **kwargs)

Bases: SQLiteStore, 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 nectarstorage.sqlite.SQLiteStore. The interface is defined in nectarstorage.interfaces.ConfigInterface.

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

Bases: SQLiteStore, 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 nectarstorage.ram.InRamStore. The interface is defined in nectarstorage.interfaces.KeyInterface.

Note

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

class nectarstorage.base.SqliteEncryptedTokenStore(*args, **kwargs)

Bases: SQLiteStore, TokenEncryption

This is the key storage that stores the account name and the encrypted token in the token table in the SQLite3 database.

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

Note

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

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

Bases: SQLiteStore, 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 nectarstorage.ram.InRamStore. The interface is defined in nectarstorage.interfaces.KeyInterface.

add(wif, pub=None)

Add a new public/private key pair (correspondence has to be checked elsewhere!)

Parameters:
  • pub (str) – Public key

  • wif (str) – Private key

delete(key)

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

class nectarstorage.base.SqlitePlainTokenStore(*args, **kwargs)

Bases: SQLiteStore, TokenInterface

This is the token storage that stores the public key and the unencrypted private key in the tokens table in the SQLite3 database.

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

add(token, name=None)

Add a new token entry (correspondence has to be checked elsewhere!)

Parameters:
  • name (str) – Public identifier

  • token (str) – Token value

delete(key)

Delete a key from the store

Parameters:

value (str) – Value

getPrivateKeyForPublicKey(pub)

Returns the (possibly encrypted) token that corresponds to a name

Parameters:

pub (str) – Public key

The encryption scheme is BIP38

getPublicNames()

Returns the public token names stored in the database

is_encrypted()

Returns False, as we are not encrypted here

updateToken(name, token)
class nectarstorage.base.TokenEncryption(*args, **kwargs)

Bases: MasterPassword, EncryptedTokenInterface

This is an interface class that provides the methods required for EncryptedTokenInterface and links them to the MasterPassword-provided functionatlity, accordingly.

add(token, name=None)

Add a new token entry (correspondence has to be checked elsewhere!)

Parameters:
  • name (str) – Public identifier

  • token (str) – Token value

getPrivateKeyForPublicKey(pub)

Returns the (possibly encrypted) token that corresponds to a name

Parameters:

pub (str) – Public key

The encryption scheme is BIP38

getPublicNames()

Returns the public token names stored in the database

is_encrypted()

Returns True/False to indicate required use of unlock

updateToken(name, token)