pub struct DbBlob {
pub version: u32,
pub start_crypto_blob: u32,
pub total_length: u32,
pub random_signature: [u8; 16],
pub sequence: u32,
pub idle_timeout: u32,
pub lock_on_sleep: bool,
pub salt: [u8; 20],
pub iv: [u8; 8],
pub blob_signature: [u8; 20],
pub public_acl: Vec<u8>,
pub crypto_blob: Vec<u8>,
}Expand description
The fixed part of a DbBlob, the record that makes a keychain unlockable.
Fields§
§version: u32§start_crypto_blob: u32Offset of the encrypted region; also the end of the public ACL.
total_length: u32§random_signature: [u8; 16]§sequence: u32§idle_timeout: u32§lock_on_sleep: bool§salt: [u8; 20]§iv: [u8; 8]§blob_signature: [u8; 20]Legacy HMAC-SHA1 of the blob, keyed by the signing key. securityd
refuses to unlock a keychain whose signature does not match, so this is
computed on write; see Self::sign.
public_acl: Vec<u8>Public ACL, between the fixed part and the encrypted region. This one does not follow the item-ACL layout, so it is carried as bytes.
crypto_blob: Vec<u8>The encrypted region: the database’s own keys.
Implementations§
Source§impl DbBlob
impl DbBlob
pub fn parse(data: &[u8]) -> Result<Self>
pub fn to_bytes(&self) -> Vec<u8> ⓘ
Sourcepub fn unlock(&self, password: &[u8]) -> Result<DbKeys>
pub fn unlock(&self, password: &[u8]) -> Result<DbKeys>
Unlock: derive the master key and open the crypto blob.
Sourcepub fn seal(&mut self, password: &[u8], keys: &DbKeys) -> Result<()>
pub fn seal(&mut self, password: &[u8], keys: &DbKeys) -> Result<()>
Build the crypto blob for a set of database keys, and sign the result.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DbBlob
impl RefUnwindSafe for DbBlob
impl Send for DbBlob
impl Sync for DbBlob
impl Unpin for DbBlob
impl UnsafeUnpin for DbBlob
impl UnwindSafe for DbBlob
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