pub struct EncryptParams {Show 13 fields
pub version: i64,
pub revision: i64,
pub permissions: u32,
pub cipher: Cipher,
pub embedded_cipher: Option<Cipher>,
pub string_cipher: Cipher,
pub key_len: usize,
pub encrypt_metadata: bool,
pub o: Box<[u8]>,
pub u: Box<[u8]>,
pub oe: Box<[u8]>,
pub ue: Box<[u8]>,
pub perms: Box<[u8]>,
}Expand description
The /Encrypt dictionary as a record of what the file said.
Nothing here is validated against a password yet; cipher and key_len
are the one derived pair, because resolving them is where a malformed
dictionary is rejected.
Fields§
§version: i64/V, the algorithm version. Default 0.
revision: i64/R, the handler revision. Default 0.
permissions: u32/P, the permission flags, as the unsigned word they are compared as.
Default 0xFFFF_FFFF.
cipher: CipherThe cipher /V, /CF and /CFM resolve to.
This is the stream class’s cipher (/StmF). See string_cipher.
embedded_cipher: Option<Cipher>The cipher /EFF resolves to when it differs from Self::cipher
(ISO 32000-1 §7.6.5 table 20), and None when the embedded class uses
the stream cipher — which table 20 makes the default.
string_cipher: Cipher[oracle-bug] The cipher the string class (/StrF) resolves to,
independently of /StmF.
§7.6.5 defines /StmF and /StrF as two independent entries, each
defaulting to Identity, and says nothing forbidding them from
differing. So /StmF /StdCF /StrF /StdCF2 opens even when the two
/CF entries are identical, and so does a V≥4 document with
neither entry present, which is two Identity defaults.
Only the two values §7.6.5 makes observable at this seam are carried:
a class is either the file’s cipher or Identity. A document naming
two different non-Identity filters would need two keys, which no
corpus file does and which this record deliberately does not model —
such a file resolves both classes to the stream filter’s cipher.
key_len: usizeThe file encryption key length in bytes, 0 to 32.
encrypt_metadata: bool/EncryptMetadata. Default true.
o: Box<[u8]>/O, the owner password entry.
u: Box<[u8]>/U, the user password entry.
oe: Box<[u8]>/OE, the owner encrypted file key (revision 5 and up).
ue: Box<[u8]>/UE, the user encrypted file key (revision 5 and up).
perms: Box<[u8]>/Perms, the encrypted permission block (revision 5 and up).
Trait Implementations§
Source§impl Clone for EncryptParams
impl Clone for EncryptParams
Source§fn clone(&self) -> EncryptParams
fn clone(&self) -> EncryptParams
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more