Struct tugger_apple_codesign::EmbeddedSignature [−][src]
pub struct EmbeddedSignature<'a> { pub magic: CodeSigningMagic, pub length: u32, pub count: u32, pub data: &'a [u8], pub blobs: Vec<BlobEntry<'a>>, }
Expand description
Represents embedded signature data in a Mach-O binary.
This type represents a lightly parsed SuperBlob
with
CodeSigningMagic::EmbeddedSignature embedded in a Mach-O binary. It is the
most common embedded signature data format you are likely to encounter.
Fields
magic: CodeSigningMagic
Magic value from header.
length: u32
Length of this super blob.
count: u32
Number of blobs in this super blob.
data: &'a [u8]
Raw data backing this super blob.
blobs: Vec<BlobEntry<'a>>
All the blobs within this super blob.
Implementations
Attempt to parse an embedded signature super blob from data.
The argument to this function is likely the subset of the
__LINKEDIT
Mach-O section that the LC_CODE_SIGNATURE
load instructions
points it.
Find the first occurrence of the specified slot.
pub fn find_slot_parsed(
&self,
slot: CodeSigningSlot
) -> Result<Option<ParsedBlob<'_>>, AppleCodesignError>
pub fn code_directory(
&self
) -> Result<Option<Box<CodeDirectoryBlob<'_>>>, AppleCodesignError>
pub fn code_directory(
&self
) -> Result<Option<Box<CodeDirectoryBlob<'_>>>, AppleCodesignError>
Attempt to resolve a parsed CodeDirectoryBlob
for this signature data.
Returns Err on data parsing error or if the blob slot didn’t contain a code directory.
Returns Ok(None)
if there is no code directory slot.
Attempt to resolve a parsed EntitlementsBlob for this signature data.
Returns Err on data parsing error or if the blob slot didn’t contain an entitlments blob.
Returns Ok(None)
if there is no entitlements slot.
pub fn code_requirements(
&self
) -> Result<Option<Box<RequirementSetBlob<'_>>>, AppleCodesignError>
pub fn code_requirements(
&self
) -> Result<Option<Box<RequirementSetBlob<'_>>>, AppleCodesignError>
Attempt to resolve a parsed RequirementSetBlob for this signature data.
Returns Err on data parsing error or if the blob slot didn’t contain a requirements blob.
Returns Ok(None)
if there is no requirements slot.
Attempt to resolve raw CMS signature data.
The returned data is likely DER PKCS#7 with the root object pkcs7-signedData (1.2.840.113549.1.7.2).