Struct security_framework::item::ItemSearchOptions
source · pub struct ItemSearchOptions { /* private fields */ }
Expand description
A builder type to search for items in keychains.
Implementations§
source§impl ItemSearchOptions
impl ItemSearchOptions
sourcepub fn class(&mut self, class: ItemClass) -> &mut Self
pub fn class(&mut self, class: ItemClass) -> &mut Self
Search only for items of the specified class.
sourcepub fn key_class(&mut self, key_class: KeyClass) -> &mut Self
pub fn key_class(&mut self, key_class: KeyClass) -> &mut Self
Search only for keys of the specified class. Also sets self.class to ItemClass::key().
sourcepub fn load_refs(&mut self, load_refs: bool) -> &mut Self
pub fn load_refs(&mut self, load_refs: bool) -> &mut Self
Load Security Framework objects (SecCertificate
, SecKey
, etc) for
the results.
sourcepub fn load_attributes(&mut self, load_attributes: bool) -> &mut Self
pub fn load_attributes(&mut self, load_attributes: bool) -> &mut Self
Load Security Framework object attributes for the results.
sourcepub fn load_data(&mut self, load_data: bool) -> &mut Self
pub fn load_data(&mut self, load_data: bool) -> &mut Self
Load Security Framework objects data for the results.
sourcepub fn limit<T: Into<Limit>>(&mut self, limit: T) -> &mut Self
pub fn limit<T: Into<Limit>>(&mut self, limit: T) -> &mut Self
Limit the number of search results.
If this is not called, the default limit is 1.
sourcepub fn access_group_token(&mut self) -> &mut Self
pub fn access_group_token(&mut self) -> &mut Self
Sets kSecAttrAccessGroup
to kSecAttrAccessGroupToken
sourcepub fn pub_key_hash(&mut self, pub_key_hash: &[u8]) -> &mut Self
pub fn pub_key_hash(&mut self, pub_key_hash: &[u8]) -> &mut Self
Search for a certificate with the given public key hash.
This is only compatible with ItemClass::certificate, to search for a key by public key hash use ItemSearchOptions::application_label instead.
sourcepub fn application_label(&mut self, app_label: &[u8]) -> &mut Self
pub fn application_label(&mut self, app_label: &[u8]) -> &mut Self
Search for a key with the given public key hash.
This is only compatible with ItemClass::key, to search for a certificate by the public key hash use ItemSearchOptions::pub_key_hash instead.
sourcepub fn search(&self) -> Result<Vec<SearchResult>>
pub fn search(&self) -> Result<Vec<SearchResult>>
Search for objects.