pub fn decrypt_document(
doc: &Document,
options: WriteOptions,
) -> Result<Vec<u8>>Expand description
rewrite_document, named for the decryption it performs when doc
was opened under a password: its content already reads as plaintext
through Document::get, and the fresh Writer this builds carries
no /Encrypt of its own, so the output is plainly unencrypted no
matter what protected the input. Refuses a Document::is_locked
doc exactly as Importer::new does, a second safeguard behind
Document::load_with_password’s own refusal of a wrong or missing
password: that refusal happens before a Document exists, so a locked
one never reaches this function through the public load path in the
first place.