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>>,
}

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

impl<'a> EmbeddedSignature<'a>[src]

pub fn from_bytes(data: &'a [u8]) -> Result<Self, AppleCodesignError>[src]

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.

pub fn find_slot(&self, slot: CodeSigningSlot) -> Option<&BlobEntry<'_>>[src]

Find the first occurrence of the specified slot.

pub fn find_slot_parsed(
    &self,
    slot: CodeSigningSlot
) -> Result<Option<ParsedBlob<'_>>, AppleCodesignError>
[src]

pub fn code_directory(
    &self
) -> Result<Option<Box<CodeDirectoryBlob<'_>>>, AppleCodesignError>
[src]

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.

pub fn entitlements(
    &self
) -> Result<Option<Box<EntitlementsBlob<'_>>>, AppleCodesignError>
[src]

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>
[src]

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.

pub fn signature_data(&self) -> Result<Option<&[u8]>, AppleCodesignError>[src]

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

impl<'a> Debug for EmbeddedSignature<'a>[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T> Instrument for T[src]

fn instrument(self, span: Span) -> Instrumented<Self>[src]

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

fn in_current_span(self) -> Instrumented<Self>[src]

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

impl<T> SendSyncUnwindSafe for T where
    T: Send + Sync + UnwindSafe + ?Sized
[src]