pub struct EmbeddedSignatureBuilder<'a> { /* private fields */ }Expand description
An entity for producing and writing EmbeddedSignature.
This entity can be used to incrementally build up super blob data.
Implementations
sourceimpl<'a> EmbeddedSignatureBuilder<'a>
impl<'a> EmbeddedSignatureBuilder<'a>
sourcepub fn new_for_stapling(
signature: EmbeddedSignature<'a>
) -> Result<Self, AppleCodesignError>
pub fn new_for_stapling(
signature: EmbeddedSignature<'a>
) -> Result<Self, AppleCodesignError>
Create a new instance suitable for stapling a notarization ticket.
This starts with an existing EmbeddedSignature / superblob because stapling a notarization ticket just adds a new ticket slot without modifying existing slots.
sourcepub fn code_directory(&self) -> Option<&CodeDirectoryBlob<'_>>
pub fn code_directory(&self) -> Option<&CodeDirectoryBlob<'_>>
Obtain the code directory registered with this instance.
sourcepub fn add_blob(
&mut self,
slot: CodeSigningSlot,
blob: BlobData<'a>
) -> Result<(), AppleCodesignError>
pub fn add_blob(
&mut self,
slot: CodeSigningSlot,
blob: BlobData<'a>
) -> Result<(), AppleCodesignError>
Register a blob into a slot.
There can only be a single blob per slot. Last write wins.
The code directory and embedded signature cannot be added using this method.
Blobs cannot be registered after a code directory or signature are added, as this would invalidate the signature.
sourcepub fn add_code_directory(
&mut self,
cd_slot: CodeSigningSlot,
cd: CodeDirectoryBlob<'a>
) -> Result<&CodeDirectoryBlob<'_>, AppleCodesignError>
pub fn add_code_directory(
&mut self,
cd_slot: CodeSigningSlot,
cd: CodeDirectoryBlob<'a>
) -> Result<&CodeDirectoryBlob<'_>, AppleCodesignError>
Register a CodeDirectoryBlob with this builder.
This is the recommended mechanism to register a Code Directory with this instance.
When a code directory is registered, this method will automatically ensure digests of previously registered blobs/slots are present in the code directory. This removes the burden from callers of having to keep the code directory in sync with other registered blobs.
This function accepts the slot to add the code directory to because alternative slots can be registered.
sourcepub fn add_alternative_code_directory(
&mut self,
cd: CodeDirectoryBlob<'a>
) -> Result<&CodeDirectoryBlob<'_>, AppleCodesignError>
pub fn add_alternative_code_directory(
&mut self,
cd: CodeDirectoryBlob<'a>
) -> Result<&CodeDirectoryBlob<'_>, AppleCodesignError>
Add an alternative code directory.
This is a wrapper for Self::add_code_directory() that has logic for determining the appropriate slot for the code directory.
sourcepub fn create_cms_signature(
&mut self,
signing_key: &dyn KeyInfoSigner,
signing_cert: &CapturedX509Certificate,
time_stamp_url: Option<&Url>,
certificates: impl Iterator<Item = CapturedX509Certificate>
) -> Result<(), AppleCodesignError>
pub fn create_cms_signature(
&mut self,
signing_key: &dyn KeyInfoSigner,
signing_cert: &CapturedX509Certificate,
time_stamp_url: Option<&Url>,
certificates: impl Iterator<Item = CapturedX509Certificate>
) -> Result<(), AppleCodesignError>
The a CMS signature and register its signature blob.
signing_key and signing_cert denote the keypair being used to produce a
cryptographic signature.
time_stamp_url is an optional time-stamp protocol server to use to record
the signature in.
certificates are extra X.509 certificates to register in the signing chain.
This method errors if called before a code directory is registered.
sourcepub fn add_notarization_ticket(
&mut self,
ticket_data: Vec<u8>
) -> Result<(), AppleCodesignError>
pub fn add_notarization_ticket(
&mut self,
ticket_data: Vec<u8>
) -> Result<(), AppleCodesignError>
Add notarization ticket data.
This will register a new ticket slot holding the notarization ticket data.
sourcepub fn create_superblob(&self) -> Result<Vec<u8>, AppleCodesignError>
pub fn create_superblob(&self) -> Result<Vec<u8>, AppleCodesignError>
Create the embedded signature “superblob” data.
Trait Implementations
sourceimpl<'a> Debug for EmbeddedSignatureBuilder<'a>
impl<'a> Debug for EmbeddedSignatureBuilder<'a>
sourceimpl<'a> Default for EmbeddedSignatureBuilder<'a>
impl<'a> Default for EmbeddedSignatureBuilder<'a>
sourcefn default() -> EmbeddedSignatureBuilder<'a>
fn default() -> EmbeddedSignatureBuilder<'a>
Auto Trait Implementations
impl<'a> RefUnwindSafe for EmbeddedSignatureBuilder<'a>
impl<'a> Send for EmbeddedSignatureBuilder<'a>
impl<'a> Sync for EmbeddedSignatureBuilder<'a>
impl<'a> Unpin for EmbeddedSignatureBuilder<'a>
impl<'a> UnwindSafe for EmbeddedSignatureBuilder<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<T> FmtForward for T
impl<T> FmtForward for T
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
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>
impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read morefn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read morefn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> Rwhere
Self: Borrow<B>,
B: 'a + ?Sized,
R: 'a,
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> Rwhere
Self: Borrow<B>,
B: 'a + ?Sized,
R: 'a,
fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> Rwhere
Self: BorrowMut<B>,
B: 'a + ?Sized,
R: 'a,
fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> Rwhere
Self: BorrowMut<B>,
B: 'a + ?Sized,
R: 'a,
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> Rwhere
Self: AsRef<U>,
U: 'a + ?Sized,
R: 'a,
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> Rwhere
Self: AsRef<U>,
U: 'a + ?Sized,
R: 'a,
self, then passes self.as_ref() into the pipe function.fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> Rwhere
Self: AsMut<U>,
U: 'a + ?Sized,
R: 'a,
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> Rwhere
Self: AsMut<U>,
U: 'a + ?Sized,
R: 'a,
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> Rwhere
Self: Deref<Target = T>,
T: 'a + ?Sized,
R: 'a,
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> Rwhere
Self: Deref<Target = T>,
T: 'a + ?Sized,
R: 'a,
self, then passes self.deref() into the pipe function.impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Tap for T
impl<T> Tap for T
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Selfwhere
Self: Borrow<B>,
B: ?Sized,
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Selfwhere
Self: Borrow<B>,
B: ?Sized,
Borrow<B> of a value. Read morefn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere
Self: BorrowMut<B>,
B: ?Sized,
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere
Self: BorrowMut<B>,
B: ?Sized,
BorrowMut<B> of a value. Read morefn tap_ref<R>(self, func: impl FnOnce(&R)) -> Selfwhere
Self: AsRef<R>,
R: ?Sized,
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Selfwhere
Self: AsRef<R>,
R: ?Sized,
AsRef<R> view of a value. Read morefn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere
Self: AsMut<R>,
R: ?Sized,
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere
Self: AsMut<R>,
R: ?Sized,
AsMut<R> view of a value. Read morefn tap_deref<T>(self, func: impl FnOnce(&T)) -> Selfwhere
Self: Deref<Target = T>,
T: ?Sized,
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Selfwhere
Self: Deref<Target = T>,
T: ?Sized,
Deref::Target of a value. Read morefn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Selfwhere
Self: DerefMut<Target = T> + Deref,
T: ?Sized,
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Selfwhere
Self: DerefMut<Target = T> + Deref,
T: ?Sized,
Deref::Target of a value. Read morefn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds. Read morefn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Selfwhere
Self: Borrow<B>,
B: ?Sized,
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Selfwhere
Self: Borrow<B>,
B: ?Sized,
.tap_borrow() only in debug builds, and is erased in release
builds. Read morefn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere
Self: BorrowMut<B>,
B: ?Sized,
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere
Self: BorrowMut<B>,
B: ?Sized,
.tap_borrow_mut() only in debug builds, and is erased in release
builds. Read morefn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Selfwhere
Self: AsRef<R>,
R: ?Sized,
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Selfwhere
Self: AsRef<R>,
R: ?Sized,
.tap_ref() only in debug builds, and is erased in release
builds. Read morefn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere
Self: AsMut<R>,
R: ?Sized,
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere
Self: AsMut<R>,
R: ?Sized,
.tap_ref_mut() only in debug builds, and is erased in release
builds. Read more