pub struct KeyDataTrailer {
pub committed: u32,
pub wraps: Vec<PasscodeWrap>,
}Expand description
The 7.3 trailer: the committed generation and the passcode wraps.
Fields§
§committed: u32Generation whose wraps are live; others are crash leftovers.
wraps: Vec<PasscodeWrap>Every wrap in file order, live or not.
Implementations§
Source§impl KeyDataTrailer
impl KeyDataTrailer
Sourcepub fn parse(blob: &[u8]) -> Result<Self>
pub fn parse(blob: &[u8]) -> Result<Self>
Decodes the trailer blob (ReadKeyData).
A newer format is read by its known prefix with up to
MAX_NEWER_FORMAT_WRAP_COUNT wraps. A wrap whose cost is above the
read caps is kept; open_local_key refuses it later.
§Errors
Error::QDataStreamFailedwhen the blob is cut short.Error::KeyDataInvalidfor a bad magic, a wrap count above the format limit, an invalid KDF (kind 0 included), a wrap salt shorter thankdf::PASSCODE_SALT_MIN_SIZE, or a duplicate generation.
Sourcepub fn encode(&self) -> Result<Vec<u8>>
pub fn encode(&self) -> Result<Vec<u8>>
Encodes the trailer blob in format KEY_DATA_FORMAT_VERSION
(WriteKeyData).
§Errors
Error::QDataStreamFailed when a count or blob does not fit a u32.
Sourcepub fn live_wraps(&self) -> impl Iterator<Item = &PasscodeWrap>
pub fn live_wraps(&self) -> impl Iterator<Item = &PasscodeWrap>
Wraps of the committed generation.
Trait Implementations§
Source§impl Clone for KeyDataTrailer
impl Clone for KeyDataTrailer
Source§impl Debug for KeyDataTrailer
impl Debug for KeyDataTrailer
impl Eq for KeyDataTrailer
Source§impl PartialEq for KeyDataTrailer
impl PartialEq for KeyDataTrailer
impl StructuralPartialEq for KeyDataTrailer
Auto Trait Implementations§
impl Freeze for KeyDataTrailer
impl RefUnwindSafe for KeyDataTrailer
impl Send for KeyDataTrailer
impl Sync for KeyDataTrailer
impl Unpin for KeyDataTrailer
impl UnsafeUnpin for KeyDataTrailer
impl UnwindSafe for KeyDataTrailer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more