pub struct KeyHeader {Show 14 fields
pub header_version: u32,
pub csp_id: Guid,
pub blob_type: KeyBlobType,
pub format: u32,
pub algorithm_id: u32,
pub key_class: KeyClass,
pub logical_key_size_in_bits: u32,
pub key_attr: u32,
pub key_usage: u32,
pub start_date: CssmDate,
pub end_date: CssmDate,
pub wrap_algorithm_id: u32,
pub wrap_mode: u32,
pub reserved: u32,
}Expand description
CSSM_KEYHEADER, the 76-byte header of every stored key.
Fields§
§header_version: u32§csp_id: Guid§blob_type: KeyBlobType§format: u32§algorithm_id: u32§key_class: KeyClass§logical_key_size_in_bits: u32§key_attr: u32CSSM_KEYATTR_FLAGS.
key_usage: u32CSSM_KEYUSE.
start_date: CssmDate§end_date: CssmDate§wrap_algorithm_id: u32§wrap_mode: u32§reserved: u32Implementations§
Source§impl KeyHeader
impl KeyHeader
pub const LEN: usize = 76
pub fn parse(data: &[u8]) -> Result<Self>
pub fn write(&self, out: &mut Vec<u8>)
pub fn to_bytes(&self) -> Vec<u8> ⓘ
Sourcepub fn item_key() -> Self
pub fn item_key() -> Self
The header macOS writes for a wrapped item key: a 192-bit 3DES session key from the Apple CSP that may only encrypt and decrypt its item.
securityd checks these bits before it will use the key, so they are the
values security writes, not a plausible-looking set.
key_size_matches_apples_header pins the whole header to a keychain macOS
wrote.
Source§impl KeyHeader
impl KeyHeader
Sourcepub fn private_key(key_size_in_bits: u32) -> Self
pub fn private_key(key_size_in_bits: u32) -> Self
The header macOS writes for an imported RSA private key.
The bits are the ones security import writes: permanent, sensitive,
always sensitive, extractable, and usable for anything.
key_size is recorded in the record’s attributes as well; the header
carries the logical size.
Trait Implementations§
impl Eq for KeyHeader
impl StructuralPartialEq for KeyHeader
Auto Trait Implementations§
impl Freeze for KeyHeader
impl RefUnwindSafe for KeyHeader
impl Send for KeyHeader
impl Sync for KeyHeader
impl Unpin for KeyHeader
impl UnsafeUnpin for KeyHeader
impl UnwindSafe for KeyHeader
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