Struct apple_codesign::CodeResources
source · [−]pub struct CodeResources { /* private fields */ }
Expand description
Represents a _CodeSignature/CodeResources
XML plist.
This file/type represents a collection of file-based resources whose content is digested and captured in this file.
Implementations
sourceimpl CodeResources
impl CodeResources
sourcepub fn from_xml(xml: &[u8]) -> Result<Self, AppleCodesignError>
pub fn from_xml(xml: &[u8]) -> Result<Self, AppleCodesignError>
Construct an instance by parsing an XML plist.
sourcepub fn to_writer_xml(
&self,
writer: impl Write
) -> Result<(), AppleCodesignError>
pub fn to_writer_xml(
&self,
writer: impl Write
) -> Result<(), AppleCodesignError>
Serialize an instance to XML.
sourcepub fn add_rule(&mut self, rule: CodeResourcesRule)
pub fn add_rule(&mut self, rule: CodeResourcesRule)
Add a rule to this instance in the <rules>
section.
sourcepub fn add_rule2(&mut self, rule: CodeResourcesRule)
pub fn add_rule2(&mut self, rule: CodeResourcesRule)
Add a rule to this instance in the <rules2>
section.
sourcepub fn seal_regular_file(
&mut self,
path: impl ToString,
content: impl AsRef<[u8]>,
optional: bool
) -> Result<(), AppleCodesignError>
pub fn seal_regular_file(
&mut self,
path: impl ToString,
content: impl AsRef<[u8]>,
optional: bool
) -> Result<(), AppleCodesignError>
Seal a regular file.
This will digest the content specified and record that digest in the files list.
To seal a symlink, call CodeResources::seal_symlink instead. If the file is a Mach-O file, call CodeResources::seal_macho instead.
sourcepub fn seal_symlink(&mut self, path: impl ToString, target: impl ToString)
pub fn seal_symlink(&mut self, path: impl ToString, target: impl ToString)
Seal a symlink file.
path
is the path of the symlink and target
is the path it points to.
sourcepub fn seal_macho(
&mut self,
path: impl ToString,
info: &SignedMachOInfo,
optional: bool
) -> Result<(), AppleCodesignError>
pub fn seal_macho(
&mut self,
path: impl ToString,
info: &SignedMachOInfo,
optional: bool
) -> Result<(), AppleCodesignError>
Record metadata of a previously signed Mach-O binary.
If sealing a fat/universal binary, pass in metadata for the first Mach-O within in.
Trait Implementations
sourceimpl Clone for CodeResources
impl Clone for CodeResources
sourcefn clone(&self) -> CodeResources
fn clone(&self) -> CodeResources
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for CodeResources
impl Debug for CodeResources
sourceimpl Default for CodeResources
impl Default for CodeResources
sourcefn default() -> CodeResources
fn default() -> CodeResources
Returns the “default value” for a type. Read more
sourceimpl From<&'_ CodeResources> for Value
impl From<&'_ CodeResources> for Value
sourcefn from(cr: &CodeResources) -> Self
fn from(cr: &CodeResources) -> Self
Performs the conversion.
sourceimpl PartialEq<CodeResources> for CodeResources
impl PartialEq<CodeResources> for CodeResources
sourcefn eq(&self, other: &CodeResources) -> bool
fn eq(&self, other: &CodeResources) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &CodeResources) -> bool
fn ne(&self, other: &CodeResources) -> bool
This method tests for !=
.
impl StructuralPartialEq for CodeResources
Auto Trait Implementations
impl RefUnwindSafe for CodeResources
impl Send for CodeResources
impl Sync for CodeResources
impl Unpin for CodeResources
impl UnwindSafe for CodeResources
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
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>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more