novelai_api.Keystore

class Keystore[source]

Bases: object

__init__(keystore: Dict[str, bytes] | None)[source]
data: Dict[str, Any]
create() str[source]

Create a new meta that is not in the keystore and assign a random nonce to it

decrypt(key: bytes)[source]

Decrypt the keystore. The encrypted data should be in Keystore.data

Parameters:

key – Encryption key computed from utils.get_encryption_key()

encrypt(key: bytes)[source]

Encrypt a decrypted keystore. The encrypted data will be at Keystore.data

Parameters:

key – Encryption key computed from utils.get_encryption_key()