Function apple_codesign::embedded_signature::create_superblob
source · pub fn create_superblob<'a>(
magic: CodeSigningMagic,
blobs: impl Iterator<Item = &'a (CodeSigningSlot, Vec<u8>)>
) -> Result<Vec<u8>, AppleCodesignError>Expand description
Create the binary content for a SuperBlob.
Examples found in repository?
src/embedded_signature_builder.rs (line 340)
323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341
pub fn create_superblob(&self) -> Result<Vec<u8>, AppleCodesignError> {
if matches!(self.state, BlobsState::Empty | BlobsState::SpecialAdded) {
return Err(AppleCodesignError::SignatureBuilder(
"code directory required in order to materialize superblob",
));
}
let blobs = self
.blobs
.iter()
.map(|(slot, blob)| {
let data = blob.to_blob_bytes()?;
Ok((*slot, data))
})
.collect::<Result<Vec<_>, AppleCodesignError>>()?;
create_superblob(CodeSigningMagic::EmbeddedSignature, blobs.iter())
}