pub struct MasterKeyFile {
pub guid: String,
pub master_key: Option<MasterKey>,
}Expand description
The parsed masterkey-file header plus the embedded encrypted masterkey.
Fields§
§guid: StringThe {guid} this file is named after (identifies which key a blob needs).
master_key: Option<MasterKey>The encrypted masterkey subfield, if present (MasterKeyLen > 0).
Implementations§
Source§impl MasterKeyFile
impl MasterKeyFile
Sourcepub fn parse(data: &[u8]) -> Result<Self, DpapiError>
pub fn parse(data: &[u8]) -> Result<Self, DpapiError>
Parse the 128-byte header + subfields. Only the MasterKey subfield is decoded; BackupKey/CredHist/DomainKey are skipped.
Header layout (verified byte-for-byte against real Windows Server 2025 masterkey
files at C:\Users\<u>\AppData\Roaming\Microsoft\Protect\<SID>\<GUID>):
0..4 Version (u32 = 2 on modern Windows)
4..8 Unk1
8..12 Unk2
12..84 Guid (72 bytes UTF-16LE, the file's own {guid} name)
84..88 Unk3
88..92 Policy
92..96 Flags (u32 — impacket had this as u64 in older versions; MODERN is u32)
96..104 MasterKeyLen (u64)
104..112 BackupKeyLen (u64)
112..120 CredHistLen (u64)
120..128 DomainKeyLen (u64)
128.. [ MasterKey ][ BackupKey ][ CredHist ][ DomainKey ] concatenatedTrait Implementations§
Source§impl Clone for MasterKeyFile
impl Clone for MasterKeyFile
Auto Trait Implementations§
impl Freeze for MasterKeyFile
impl RefUnwindSafe for MasterKeyFile
impl Send for MasterKeyFile
impl Sync for MasterKeyFile
impl Unpin for MasterKeyFile
impl UnsafeUnpin for MasterKeyFile
impl UnwindSafe for MasterKeyFile
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