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 case_insensitive(&mut self, case_insensitive: Option<bool>) -> &mut Self
pub fn case_insensitive(&mut self, case_insensitive: Option<bool>) -> &mut Self
Whether search for an item should be case insensitive or not.
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 trusted_only(&mut self, trusted_only: Option<bool>) -> &mut Self
pub fn trusted_only(&mut self, trusted_only: Option<bool>) -> &mut Self
Whether untrusted certificates should be returned.
sourcepub fn service(&mut self, service: &str) -> &mut Self
pub fn service(&mut self, service: &str) -> &mut Self
Search for an item with the given service.
sourcepub fn subject(&mut self, subject: &str) -> &mut Self
pub fn subject(&mut self, subject: &str) -> &mut Self
Search for an item with exactly the given subject.
sourcepub fn account(&mut self, account: &str) -> &mut Self
pub fn account(&mut self, account: &str) -> &mut Self
Search for an item with the given account.
sourcepub fn access_group(&mut self, access_group: &str) -> &mut Self
pub fn access_group(&mut self, access_group: &str) -> &mut Self
Search for an item with a specific access group.
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.