pub struct Keychain {
pub version: u32,
pub header_size: u32,
pub auth_offset: u32,
pub tables: Vec<Table>,
pub commit_version: Option<u32>,
}Expand description
A parsed keychain database.
Fields§
§version: u32§header_size: u32Header size field (16 in every observed file).
auth_offset: u32Purpose unknown; 0 in every observed file.
tables: Vec<Table>Tables in file order. Order is preserved because the file’s table offset array is written in this order.
commit_version: Option<u32>A u32 that follows the tables array, outside its declared size. macOS
writes 1 for a fresh keychain and increments it once per committed
write, so it reads as a commit counter. Preserved, and bumped by
Self::bump_commit_version when this code modifies the database.
None for a file that has no such trailer.
Implementations§
Source§impl Keychain
impl Keychain
Sourcepub fn parse(data: &[u8]) -> Result<Self>
pub fn parse(data: &[u8]) -> Result<Self>
Parse a keychain image. The schema is read from the file itself.
Sourcepub fn bump_commit_version(&mut self)
pub fn bump_commit_version(&mut self)
Record another committed write, the way macOS does.
pub fn table(&self, record_type: RecordType) -> Option<&Table>
pub fn table_mut(&mut self, record_type: RecordType) -> Option<&mut Table>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Keychain
impl RefUnwindSafe for Keychain
impl Send for Keychain
impl Sync for Keychain
impl Unpin for Keychain
impl UnsafeUnpin for Keychain
impl UnwindSafe for Keychain
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