pub enum PasswordEncoding {
AsGiven,
SaslPrepped,
Latin1ToUtf8,
Utf8ToLatin1,
}Expand description
Which spelling of a password unlocked a document.
The authentication path tries a document’s password in several spellings
(see try_password) and this records the one that worked. This crate
never sets a password — building an /Encrypt dictionary is out of
scope, and the save path re-uses the file key the original password already
produced — so the value is reportable state rather than an input to
anything here.
Variants§
AsGiven
The password bytes as supplied unlocked the document.
SaslPrepped
The bytes were valid UTF-8, SASLprep (RFC 4013) changed them, and the
prepared form — re-encoded as UTF-8 and cut to 127 bytes — unlocked the
document. ISO 32000-2 §7.6.4.3.3’s own preparation, revision 6 only.
Latin1ToUtf8
Each byte was read as a Latin-1 scalar and re-encoded as UTF-8 (revision 5 and up, where passwords are nominally UTF-8).
Utf8ToLatin1
The bytes were decoded as UTF-8 and narrowed to Latin-1 (revision 2 to 4, which hash raw bytes).
Trait Implementations§
Source§impl Clone for PasswordEncoding
impl Clone for PasswordEncoding
Source§fn clone(&self) -> PasswordEncoding
fn clone(&self) -> PasswordEncoding
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more