#[repr(C)]pub struct SecStaticCode { /* private fields */ }
CSCommon
only.Expand description
This is the type of a reference to static code on disk.
See also Apple’s documentation
Implementations§
Source§impl SecStaticCode
impl SecStaticCode
Sourcepub unsafe fn create_with_path(
path: &CFURL,
flags: SecCSFlags,
static_code: NonNull<*const SecStaticCode>,
) -> i32
Available on crate feature SecStaticCode
only.
pub unsafe fn create_with_path( path: &CFURL, flags: SecCSFlags, static_code: NonNull<*const SecStaticCode>, ) -> i32
SecStaticCode
only.Given a path to a file system object, create a SecStaticCode object representing the code at that location, if possible. Such a SecStaticCode is not inherently linked to running code in the system.
It is possible to create a SecStaticCode object from an unsigned code object. Most uses of such an object will return the errSecCSUnsigned error. However, SecCodeCopyPath and SecCodeCopySigningInformation can be safely applied to such objects.
Parameter path
: A path to a location in the file system. Only file:// URLs are
currently supported. For bundles, pass a URL to the root directory of the
bundle. For single files, pass a URL to the file. If you pass a URL to the
main executable of a bundle, the bundle as a whole will be generally recognized.
Caution: Paths containing embedded // or /../ within a bundle’s directory
may cause the bundle to be misconstrued. If you expect to submit such paths,
first clean them with realpath(3) or equivalent.
Parameter flags
: Optional flags. Pass kSecCSDefaultFlags for standard behavior.
Parameter staticCode
: On successful return, contains a reference to the StaticCode object
representing the code at path. Unchanged on error.
Returns: Upon success, errSecSuccess. Upon error, an OSStatus value documented in CSCommon.h or certain other Security framework headers.
Source§impl SecStaticCode
impl SecStaticCode
Sourcepub unsafe fn create_with_path_and_attributes(
path: &CFURL,
flags: SecCSFlags,
attributes: &CFDictionary,
static_code: NonNull<*const SecStaticCode>,
) -> i32
Available on crate feature SecStaticCode
only.
pub unsafe fn create_with_path_and_attributes( path: &CFURL, flags: SecCSFlags, attributes: &CFDictionary, static_code: NonNull<*const SecStaticCode>, ) -> i32
SecStaticCode
only.Given a path to a file system object, create a SecStaticCode object representing the code at that location, if possible. Such a SecStaticCode is not inherently linked to running code in the system.
It is possible to create a SecStaticCode object from an unsigned code object. Most uses of such an object will return the errSecCSUnsigned error. However, SecCodeCopyPath and SecCodeCopySigningInformation can be safely applied to such objects.
Parameter path
: A path to a location in the file system. Only file:// URLs are
currently supported. For bundles, pass a URL to the root directory of the
bundle. For single files, pass a URL to the file. If you pass a URL to the
main executable of a bundle, the bundle as a whole will be generally recognized.
Caution: Paths containing embedded // or /../ within a bundle’s directory
may cause the bundle to be misconstrued. If you expect to submit such paths,
first clean them with realpath(3) or equivalent.
Parameter flags
: Optional flags. Pass kSecCSDefaultFlags for standard behavior.
Parameter attributes
: A CFDictionary containing additional attributes of the code sought.
Parameter staticCode
: On successful return, contains a reference to the StaticCode object
representing the code at path. Unchanged on error.
Returns: Upon success, errSecSuccess. Upon error, an OSStatus value documented in CSCommon.h or certain other Security framework headers.
This can be a CFString containing a canonical architecture name (“i386” etc.), or a CFNumber specifying an architecture numerically (see mach/machine.h). This key is ignored if the code is not in Mach-O binary form. If the code is Mach-O but not universal (“thin”), the architecture specified must agree with the actual file contents.
(using the kSecCodeAttributeArchitecture key), specifies any sub-architecture by number. This key is ignored if no main architecture is specified; if it is specified by name; or if the code is not in Mach-O form.
then select the specified framework version. This key is otherwise ignored.
Source§impl SecStaticCode
impl SecStaticCode
pub unsafe fn check_validity( self: &SecStaticCode, flags: SecCSFlags, requirement: Option<&SecRequirement>, ) -> i32
SecStaticCode
only.pub unsafe fn check_validity_with_errors( self: &SecStaticCode, flags: SecCSFlags, requirement: Option<&SecRequirement>, errors: *mut *mut CFError, ) -> i32
SecStaticCode
only.Methods from Deref<Target = CFType>§
Sourcepub fn downcast_ref<T>(&self) -> Option<&T>where
T: ConcreteType,
Available on crate feature SecCustomTransform
only.
pub fn downcast_ref<T>(&self) -> Option<&T>where
T: ConcreteType,
SecCustomTransform
only.Attempt to downcast the type to that of type T
.
This is the reference-variant. Use CFRetained::downcast
if you
want to convert a retained type. See also ConcreteType
for more
details on which types support being converted to.
Sourcepub fn retain_count(&self) -> usize
Available on crate feature SecCustomTransform
only.
pub fn retain_count(&self) -> usize
SecCustomTransform
only.Get the reference count of the object.
This function may be useful for debugging. You normally do not use this function otherwise.
Beware that some things (like CFNumber
s, small CFString
s etc.) may
not have a normal retain count for optimization purposes, and can
return usize::MAX
in that case.
Trait Implementations§
Source§impl AsRef<AnyObject> for SecStaticCode
impl AsRef<AnyObject> for SecStaticCode
Source§impl AsRef<CFType> for SecStaticCode
impl AsRef<CFType> for SecStaticCode
Source§impl AsRef<SecStaticCode> for SecStaticCode
impl AsRef<SecStaticCode> for SecStaticCode
Source§impl Borrow<AnyObject> for SecStaticCode
impl Borrow<AnyObject> for SecStaticCode
Source§impl Borrow<CFType> for SecStaticCode
impl Borrow<CFType> for SecStaticCode
Source§impl ConcreteType for SecStaticCode
Available on crate feature SecStaticCode
only.
impl ConcreteType for SecStaticCode
SecStaticCode
only.Source§impl Debug for SecStaticCode
impl Debug for SecStaticCode
Source§impl Deref for SecStaticCode
impl Deref for SecStaticCode
Source§impl Hash for SecStaticCode
impl Hash for SecStaticCode
Source§impl Message for SecStaticCode
impl Message for SecStaticCode
Source§impl PartialEq for SecStaticCode
impl PartialEq for SecStaticCode
Source§impl RefEncode for SecStaticCode
impl RefEncode for SecStaticCode
Source§const ENCODING_REF: Encoding
const ENCODING_REF: Encoding
Source§impl Type for SecStaticCode
impl Type for SecStaticCode
Source§fn retain(&self) -> CFRetained<Self>where
Self: Sized,
fn retain(&self) -> CFRetained<Self>where
Self: Sized,
Source§fn as_concrete_TypeRef(&self) -> &Self
fn as_concrete_TypeRef(&self) -> &Self
core-foundation
crate.Source§unsafe fn wrap_under_get_rule(ptr: *const Self) -> CFRetained<Self>where
Self: Sized,
unsafe fn wrap_under_get_rule(ptr: *const Self) -> CFRetained<Self>where
Self: Sized,
core-foundation
crate. Read moreSource§fn as_CFTypeRef(&self) -> &CFType
fn as_CFTypeRef(&self) -> &CFType
core-foundation
crate.Source§unsafe fn wrap_under_create_rule(ptr: *const Self) -> CFRetained<Self>where
Self: Sized,
unsafe fn wrap_under_create_rule(ptr: *const Self) -> CFRetained<Self>where
Self: Sized,
core-foundation
crate. Read more