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.