mint: add seed decrypt (#403)

* mint: add seed decrypt

* add mint seed decryoption and migration tool
This commit is contained in:
callebtc
2024-02-05 16:22:53 +01:00
committed by GitHub
parent 30b6e8aa56
commit e02e4bbf49
11 changed files with 465 additions and 35 deletions

View File

@@ -518,12 +518,14 @@ class LedgerCrudSqlite(LedgerCrud):
await (conn or db).execute( # type: ignore
f"""
INSERT INTO {table_with_schema(db, 'keysets')}
(id, seed, derivation_path, valid_from, valid_to, first_seen, active, version, unit)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
(id, seed, encrypted_seed, seed_encryption_method, derivation_path, valid_from, valid_to, first_seen, active, version, unit)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
""",
(
keyset.id,
keyset.seed,
keyset.encrypted_seed,
keyset.seed_encryption_method,
keyset.derivation_path,
keyset.valid_from or timestamp_now(db),
keyset.valid_to or timestamp_now(db),