pub struct StaticCode { /* private fields */ }Expand description
Wraps SecStaticCodeRef.
Implementations§
Source§impl StaticCode
impl StaticCode
Sourcepub fn from_path(path: impl AsRef<Path>) -> Result<Self>
pub fn from_path(path: impl AsRef<Path>) -> Result<Self>
Wraps the corresponding SecStaticCodeRef operation.
Sourcepub fn from_path_with_attributes(
path: impl AsRef<Path>,
attributes: &Value,
) -> Result<Self>
pub fn from_path_with_attributes( path: impl AsRef<Path>, attributes: &Value, ) -> Result<Self>
Wraps the corresponding SecStaticCodeRef operation.
Sourcepub fn check_validity(&self) -> Result<()>
pub fn check_validity(&self) -> Result<()>
Wraps the corresponding SecStaticCodeRef operation.
Examples found in repository?
examples/07_code_signing_info.rs (line 13)
3fn main() -> Result<(), Box<dyn std::error::Error>> {
4 let code = Code::current()?;
5 let static_code = code.static_code()?;
6 let signing = code.signing_information()?;
7 let task = Task::current()?;
8 println!(
9 "path={:?} signed={} task_identifier={:?} validity_ok={}",
10 static_code.path()?.display(),
11 signing.is_signed(),
12 task.signing_identifier()?,
13 static_code.check_validity().is_ok()
14 );
15 Ok(())
16}Sourcepub fn check_validity_with_errors(
&self,
flags: CodeSigningFlags,
requirement: Option<&Requirement>,
) -> Result<()>
pub fn check_validity_with_errors( &self, flags: CodeSigningFlags, requirement: Option<&Requirement>, ) -> Result<()>
Wraps the corresponding SecStaticCodeRef operation.
Sourcepub fn check_static_validity(
&self,
flags: CodeSigningFlags,
requirement: Option<&Requirement>,
) -> Result<()>
pub fn check_static_validity( &self, flags: CodeSigningFlags, requirement: Option<&Requirement>, ) -> Result<()>
Wraps the corresponding SecStaticCodeRef operation.
Sourcepub fn check_static_validity_with_errors(
&self,
flags: CodeSigningFlags,
requirement: Option<&Requirement>,
) -> Result<()>
pub fn check_static_validity_with_errors( &self, flags: CodeSigningFlags, requirement: Option<&Requirement>, ) -> Result<()>
Wraps the corresponding SecStaticCodeRef operation.
Sourcepub fn path(&self) -> Result<PathBuf>
pub fn path(&self) -> Result<PathBuf>
Wraps the corresponding SecStaticCodeRef operation.
Examples found in repository?
examples/07_code_signing_info.rs (line 10)
3fn main() -> Result<(), Box<dyn std::error::Error>> {
4 let code = Code::current()?;
5 let static_code = code.static_code()?;
6 let signing = code.signing_information()?;
7 let task = Task::current()?;
8 println!(
9 "path={:?} signed={} task_identifier={:?} validity_ok={}",
10 static_code.path()?.display(),
11 signing.is_signed(),
12 task.signing_identifier()?,
13 static_code.check_validity().is_ok()
14 );
15 Ok(())
16}Sourcepub fn designated_requirement(&self) -> Result<String>
pub fn designated_requirement(&self) -> Result<String>
Wraps the corresponding SecStaticCodeRef operation.
Sourcepub fn signing_information(&self) -> Result<SigningInformation>
pub fn signing_information(&self) -> Result<SigningInformation>
Wraps the corresponding SecStaticCodeRef operation.
Sourcepub fn validate_file_resource(
&self,
relative_path: &str,
data: &[u8],
flags: CodeSigningFlags,
) -> Result<()>
pub fn validate_file_resource( &self, relative_path: &str, data: &[u8], flags: CodeSigningFlags, ) -> Result<()>
Wraps the corresponding SecStaticCodeRef operation.
Sourcepub fn map_memory(&self, flags: CodeSigningFlags) -> Result<()>
pub fn map_memory(&self, flags: CodeSigningFlags) -> Result<()>
Wraps the corresponding SecStaticCodeRef operation.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StaticCode
impl RefUnwindSafe for StaticCode
impl !Send for StaticCode
impl !Sync for StaticCode
impl Unpin for StaticCode
impl UnsafeUnpin for StaticCode
impl UnwindSafe for StaticCode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more