Trait tugger_apple_codesign::Blob[][src]

pub trait Blob<'a> where
    Self: Sized
{ fn magic() -> u32;
fn from_blob_bytes(data: &'a [u8]) -> Result<Self, AppleCodesignError>;
fn serialize_payload(&self) -> Result<Vec<u8>, AppleCodesignError>; fn to_blob_bytes(&self) -> Result<Vec<u8>, AppleCodesignError> { ... }
fn digest_with(
        &self,
        hash_type: DigestType
    ) -> Result<Vec<u8>, AppleCodesignError> { ... } }

Provides common features for a parsed blob type.

Required methods

fn magic() -> u32[src]

The header magic that identifies this format.

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

Attempt to construct an instance by parsing a bytes slice.

The slice begins with the 8 byte blob header denoting the magic and length.

fn serialize_payload(&self) -> Result<Vec<u8>, AppleCodesignError>[src]

Serialize the payload of this blob to bytes.

Does not include the magic or length header fields common to blobs.

Loading content...

Provided methods

fn to_blob_bytes(&self) -> Result<Vec<u8>, AppleCodesignError>[src]

Serialize this blob to bytes.

This is Blob::serialize_payload with the blob magic and length prepended.

fn digest_with(
    &self,
    hash_type: DigestType
) -> Result<Vec<u8>, AppleCodesignError>
[src]

Obtain the digest of the blob using the specified hasher.

Default implementation calls Blob::to_blob_bytes and digests that, which should always be correct.

Loading content...

Implementors

impl<'a> Blob<'a> for BlobData<'a>[src]

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

Parse blob data by reading its magic and feeding into magic-specific parser.

impl<'a> Blob<'a> for BlobWrapperBlob<'a>[src]

impl<'a> Blob<'a> for CodeDirectoryBlob<'a>[src]

impl<'a> Blob<'a> for DetachedSignatureBlob<'a>[src]

impl<'a> Blob<'a> for EmbeddedSignatureBlob<'a>[src]

impl<'a> Blob<'a> for EmbeddedSignatureOldBlob<'a>[src]

impl<'a> Blob<'a> for EntitlementsBlob<'a>[src]

impl<'a> Blob<'a> for OtherBlob<'a>[src]

impl<'a> Blob<'a> for RequirementBlob<'a>[src]

impl<'a> Blob<'a> for RequirementSetBlob<'a>[src]

Loading content...