Struct security_framework::item::ItemAddOptions
source · pub struct ItemAddOptions {
pub value: ItemAddValue,
pub account_name: Option<CFString>,
pub access_group: Option<CFString>,
pub comment: Option<CFString>,
pub description: Option<CFString>,
pub label: Option<CFString>,
pub service: Option<CFString>,
pub location: Option<Location>,
}
Expand description
Builder-pattern struct for specifying options for add_item
(SecAddItem
wrapper).
When finished populating options, call to_dictionary()
and pass the
resulting CFDictionary
to add_item
.
Fields§
§value: ItemAddValue
The value (by ref or data) of the item to add, required.
account_name: Option<CFString>
Optional kSecAttrAccount attribute.
access_group: Option<CFString>
Optional kSecAttrAccessGroup attribute.
comment: Option<CFString>
Optional kSecAttrComment attribute.
description: Option<CFString>
Optional kSecAttrDescription attribute.
label: Option<CFString>
Optional kSecAttrLabel attribute.
service: Option<CFString>
Optional kSecAttrService attribute.
location: Option<Location>
Optional keychain location.
Implementations§
source§impl ItemAddOptions
impl ItemAddOptions
sourcepub fn new(value: ItemAddValue) -> Self
pub fn new(value: ItemAddValue) -> Self
Specifies the item to add.
sourcepub fn set_account_name(&mut self, account_name: impl AsRef<str>) -> &mut Self
pub fn set_account_name(&mut self, account_name: impl AsRef<str>) -> &mut Self
Specifies the kSecAttrAccount
attribute.
sourcepub fn set_access_group(&mut self, access_group: impl AsRef<str>) -> &mut Self
pub fn set_access_group(&mut self, access_group: impl AsRef<str>) -> &mut Self
Specifies the kSecAttrAccessGroup
attribute.
sourcepub fn set_comment(&mut self, comment: impl AsRef<str>) -> &mut Self
pub fn set_comment(&mut self, comment: impl AsRef<str>) -> &mut Self
Specifies the kSecAttrComment
attribute.
sourcepub fn set_description(&mut self, description: impl AsRef<str>) -> &mut Self
pub fn set_description(&mut self, description: impl AsRef<str>) -> &mut Self
Specifies the kSecAttrDescription
attribute.
sourcepub fn set_label(&mut self, label: impl AsRef<str>) -> &mut Self
pub fn set_label(&mut self, label: impl AsRef<str>) -> &mut Self
Specifies the kSecAttrLabel
attribute.
sourcepub fn set_location(&mut self, location: Location) -> &mut Self
pub fn set_location(&mut self, location: Location) -> &mut Self
Specifies which keychain to add the item to.
sourcepub fn set_service(&mut self, service: impl AsRef<str>) -> &mut Self
pub fn set_service(&mut self, service: impl AsRef<str>) -> &mut Self
Specifies the kSecAttrService
attribute.
sourcepub fn to_dictionary(&self) -> CFDictionary
pub fn to_dictionary(&self) -> CFDictionary
Populates a CFDictionary
to be passed to