Skip to main content

EncryptParams

Struct EncryptParams 

Source
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: Cipher

The 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: usize

The 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

Source§

fn clone(&self) -> EncryptParams

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for EncryptParams

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.