#[repr(C)]pub struct SecAccessControl { /* private fields */ }
SecBase
only.Expand description
CFType representing access control for an item. SecAccessControl.h for details.
See also Apple’s documentation
Implementations§
Source§impl SecAccessControl
impl SecAccessControl
Sourcepub unsafe fn with_flags(
allocator: Option<&CFAllocator>,
protection: &CFType,
flags: SecAccessControlCreateFlags,
error: *mut *mut CFError,
) -> Option<CFRetained<SecAccessControl>>
Available on crate feature SecAccessControl
only.
pub unsafe fn with_flags( allocator: Option<&CFAllocator>, protection: &CFType, flags: SecAccessControlCreateFlags, error: *mut *mut CFError, ) -> Option<CFRetained<SecAccessControl>>
SecAccessControl
only.Creates new access control object based on protection type and additional flags.
Created access control object should be used as a value for kSecAttrAccessControl attribute in SecItemAdd, SecItemUpdate or SecKeyGeneratePair functions. Accessing keychain items or performing operations on keys which are protected by access control objects can block the execution because of UI which can appear to satisfy the access control conditions, therefore it is recommended to either move those potentially blocking operations out of the main application thread or use combination of kSecUseAuthenticationContext and kSecUseAuthenticationUI attributes to control where the UI interaction can appear.
Parameter allocator
: Allocator to be used by this instance.
Parameter protection
: Protection class to be used for the item. One of kSecAttrAccessible constants.
Parameter flags
: If no flags are set then all operations are allowed.
Parameter error
: Additional error information filled in case of failure.
Returns: Newly created access control object.
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 SecAccessControl
impl AsRef<AnyObject> for SecAccessControl
Source§impl AsRef<CFType> for SecAccessControl
impl AsRef<CFType> for SecAccessControl
Source§impl AsRef<SecAccessControl> for SecAccessControl
impl AsRef<SecAccessControl> for SecAccessControl
Source§impl Borrow<AnyObject> for SecAccessControl
impl Borrow<AnyObject> for SecAccessControl
Source§impl Borrow<CFType> for SecAccessControl
impl Borrow<CFType> for SecAccessControl
Source§impl ConcreteType for SecAccessControl
Available on crate feature SecAccessControl
only.
impl ConcreteType for SecAccessControl
SecAccessControl
only.Source§impl Debug for SecAccessControl
impl Debug for SecAccessControl
Source§impl Deref for SecAccessControl
impl Deref for SecAccessControl
Source§impl Hash for SecAccessControl
impl Hash for SecAccessControl
Source§impl Message for SecAccessControl
impl Message for SecAccessControl
Source§impl PartialEq for SecAccessControl
impl PartialEq for SecAccessControl
Source§impl RefEncode for SecAccessControl
impl RefEncode for SecAccessControl
Source§const ENCODING_REF: Encoding
const ENCODING_REF: Encoding
Source§impl Type for SecAccessControl
impl Type for SecAccessControl
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