Struct apple_codesign::EmbeddedSignature
source · [−]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
sourceimpl<'a> EmbeddedSignature<'a>
impl<'a> EmbeddedSignature<'a>
sourcepub fn from_bytes(data: &'a [u8]) -> Result<Self, AppleCodesignError>
pub fn from_bytes(data: &'a [u8]) -> Result<Self, AppleCodesignError>
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.
sourcepub fn find_slot(&self, slot: CodeSigningSlot) -> Option<&BlobEntry<'_>>
pub fn find_slot(&self, slot: CodeSigningSlot) -> Option<&BlobEntry<'_>>
Find the first occurrence of the specified slot.
pub fn find_slot_parsed(
&self,
slot: CodeSigningSlot
) -> Result<Option<ParsedBlob<'_>>, AppleCodesignError>
sourcepub 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.
sourcepub fn entitlements(
&self
) -> Result<Option<Box<EntitlementsBlob<'_>>>, AppleCodesignError>
pub fn entitlements(
&self
) -> Result<Option<Box<EntitlementsBlob<'_>>>, AppleCodesignError>
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.
sourcepub 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.
sourcepub fn signature_data(&self) -> Result<Option<&[u8]>, AppleCodesignError>
pub fn signature_data(&self) -> Result<Option<&[u8]>, AppleCodesignError>
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).
Trait Implementations
Auto Trait Implementations
impl<'a> RefUnwindSafe for EmbeddedSignature<'a>
impl<'a> Send for EmbeddedSignature<'a>
impl<'a> Sync for EmbeddedSignature<'a>
impl<'a> Unpin for EmbeddedSignature<'a>
impl<'a> UnwindSafe for EmbeddedSignature<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more