Skip to main content

StandardSecurity

Struct StandardSecurity 

Source
pub struct StandardSecurity<'a> {
    pub revision: u8,
    pub key_length: usize,
    pub owner: &'a [u8],
    pub user: &'a [u8],
    pub owner_encryption: &'a [u8],
    pub user_encryption: &'a [u8],
    pub perms: Option<&'a [u8]>,
    pub permissions: u32,
    pub id0: &'a [u8],
    pub encrypt_metadata: bool,
}
Expand description

The values of a standard security handler’s /Encrypt dictionary that authentication needs (ISO 32000-2 Table 21). The caller extracts them; byte strings are taken as stored.

Added in 0.2.0.

Fields§

§revision: u8

/R, 2–6.

§key_length: usize

The file key length in bytes (/Length / 8): 5–16 for R2–R4 (R2 is always 5); ignored for R5/R6, whose key is 32 bytes.

§owner: &'a [u8]

/O (32 bytes for R2–R4, 48 for R5/R6).

§user: &'a [u8]

/U (32 bytes for R2–R4, 48 for R5/R6).

§owner_encryption: &'a [u8]

/OE (R5/R6, 32 bytes; empty otherwise).

§user_encryption: &'a [u8]

/UE (R5/R6, 32 bytes; empty otherwise).

§perms: Option<&'a [u8]>

/Perms (R5/R6, 16 bytes), if present.

§permissions: u32

/P as an unsigned 32-bit value (see Permissions).

§id0: &'a [u8]

The first element of the trailer’s /ID (empty when absent).

§encrypt_metadata: bool

/EncryptMetadata (default true).

Trait Implementations§

Source§

impl<'a> Clone for StandardSecurity<'a>

Source§

fn clone(&self) -> Self

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<'a> Copy for StandardSecurity<'a>

Source§

impl Debug for StandardSecurity<'_>

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'a> Eq for StandardSecurity<'a>

Source§

impl<'a> PartialEq for StandardSecurity<'a>

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<'a> StructuralPartialEq for StandardSecurity<'a>

Auto Trait Implementations§

§

impl<'a> Forget for StandardSecurity<'a>

§

impl<'a> Freeze for StandardSecurity<'a>
where &'a [u8]: Freeze,

§

impl<'a> Move for StandardSecurity<'a>

§

impl<'a> RefUnwindSafe for StandardSecurity<'a>

§

impl<'a> Send for StandardSecurity<'a>
where &'a [u8]: Send,

§

impl<'a> Sync for StandardSecurity<'a>

§

impl<'a> Unpin for StandardSecurity<'a>
where &'a [u8]: Unpin,

§

impl<'a> UnsafeUnpin for StandardSecurity<'a>
where &'a [u8]: UnsafeUnpin,

§

impl<'a> UnwindSafe for StandardSecurity<'a>
where &'a [u8]: UnwindSafe,

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.