pub trait AppleSignable {
    fn code_signature(
        &self
    ) -> Result<Option<EmbeddedSignature<'_>>, AppleCodesignError>;
fn executable_segment_boundary(
        &self
    ) -> Result<(u64, u64), AppleCodesignError>;
fn code_signature_linkedit_start_offset(&self) -> Option<u32>;
fn code_signature_linkedit_end_offset(&self) -> Option<u32>;
fn code_limit_binary_offset(&self) -> Result<u64, AppleCodesignError>;
fn linkedit_data_before_signature(&self) -> Option<&[u8]>;
fn digestable_segment_data(&self) -> Vec<&[u8]>Notable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
    A: Allocator
;
fn code_signature_load_command(&self) -> Option<LinkeditDataCommand>;
fn check_signing_capability(&self) -> Result<(), AppleCodesignError>;
fn estimate_embedded_signature_size(
        &self,
        settings: &SigningSettings<'_>
    ) -> Result<usize, AppleCodesignError>; }

Required methods

Obtain the code signature in the entity.

Returns Ok(None) if no signature exists, Ok(Some) if it does, or Err if there is a parse error.

Determine the start and end offset of the executable segment of a binary.

The start offset of the code signature data within the __LINKEDIT segment.

The end offset of the code signature data within the __LINKEDIT segment.

The byte offset within the binary at which point “code” stops.

If a signature is present, this is the offset of the start of the signature. Else it represents the end of the binary.

Obtain __LINKEDIT segment data before the signature data.

Obtain slices of segment data suitable for digesting.

The slices are likely digested as part of computing digests embedded in the code directory.

Resolve the load command for the code signature.

Determines whether this crate is capable of signing a given Mach-O binary.

Code in this crate is limited in the amount of Mach-O binary manipulation it can perform (supporting rewriting all valid Mach-O binaries effectively requires low-level awareness of all Mach-O constructs in order to perform offset manipulation). This function can be used to test signing compatibility.

We currently only support signing Mach-O files already containing an embedded signature. Often linked binaries automatically contain an embedded signature containing just the code directory (without a cryptographically signed signature), so this limitation hopefully isn’t impactful.

Estimate the size in bytes of an embedded code signature.

Implementations on Foreign Types

Implementors