pub struct KeyBlob {
pub version: u32,
pub start_crypto_blob: u32,
pub total_length: u32,
pub iv: [u8; 8],
pub header: KeyHeader,
pub wrapped: WrappedKeyFields,
pub blob_signature: [u8; 20],
pub public_acl: PublicAcl,
pub crypto_blob: Vec<u8>,
}Expand description
The fixed part of a KeyBlob: one wrapped key, as stored in a key record.
Fields§
§version: u32§start_crypto_blob: u32§total_length: u32§iv: [u8; 8]§header: KeyHeaderThe key’s CSSM header.
wrapped: WrappedKeyFieldsHow the key that follows was wrapped.
blob_signature: [u8; 20]§public_acl: PublicAclThe item ACL. Parsed when it follows the layout in AclBlob, and kept
as bytes when it does not, so an unfamiliar policy still round-trips.
crypto_blob: Vec<u8>Implementations§
Source§impl KeyBlob
impl KeyBlob
pub fn parse(data: &[u8]) -> Result<Self>
pub fn to_bytes(&self) -> Vec<u8> ⓘ
Sourcepub fn unwrap_key(&self, encryption_key: &[u8]) -> Result<SecretBytes>
pub fn unwrap_key(&self, encryption_key: &[u8]) -> Result<SecretBytes>
Recover the item key this blob wraps.
Sourcepub fn sign(&mut self, signing_key: &[u8])
pub fn sign(&mut self, signing_key: &[u8])
Recompute blob_signature, the same way securityd does for a key blob.
A key blob carries the database’s version, so the algorithm follows it.
pub fn verify(&self, signing_key: &[u8]) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for KeyBlob
impl RefUnwindSafe for KeyBlob
impl Send for KeyBlob
impl Sync for KeyBlob
impl Unpin for KeyBlob
impl UnsafeUnpin for KeyBlob
impl UnwindSafe for KeyBlob
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