Skip to main content

convert_encryption

Function convert_encryption 

Source
pub fn convert_encryption(
    dir: &Path,
    options: &ConvertOptions,
) -> Result<ConvertResult, DatabaseError>
Expand description

Seals a plain database, unseals an encrypted one, or re-seals one under other keys, in place and recoverably (the stage, verify, swap and roll-back of super::restore_database).

Every file is read through from and written through to: the metadata document, every log line (fresh IVs; image references renamed where the file name changes), every image file. Image file names are a plain content hash in a plain database and a keyed one in an encrypted one, so they are recomputed and the records that name them are rewritten. Index snapshots are dropped; the next open rebuilds them. A database with an unfinished unit of work is refused.