pub struct GenerateKeyOptions {
pub key_type: Option<KeyType>,
pub size_in_bits: Option<u32>,
pub label: Option<String>,
pub token: Option<Token>,
pub location: Option<Location>,
pub access_control: Option<SecAccessControl>,
}
Expand description
Helper for creating CFDictionary
attributes for SecKey::generate
Recommended reading:
https://developer.apple.com/documentation/technotes/tn3137-on-mac-keychains
Fields§
§key_type: Option<KeyType>
kSecAttrKeyType
size_in_bits: Option<u32>
kSecAttrKeySizeInBits
label: Option<String>
kSecAttrLabel
token: Option<Token>
kSecAttrTokenID
location: Option<Location>
Which keychain to store the key in, if any.
access_control: Option<SecAccessControl>
Access control
Implementations§
Source§impl GenerateKeyOptions
impl GenerateKeyOptions
Sourcepub fn set_key_type(&mut self, key_type: KeyType) -> &mut Self
pub fn set_key_type(&mut self, key_type: KeyType) -> &mut Self
Set key_type
Sourcepub fn set_size_in_bits(&mut self, size_in_bits: u32) -> &mut Self
pub fn set_size_in_bits(&mut self, size_in_bits: u32) -> &mut Self
Set size_in_bits
Sourcepub fn set_location(&mut self, location: Location) -> &mut Self
pub fn set_location(&mut self, location: Location) -> &mut Self
Set location
Sourcepub fn set_access_control(
&mut self,
access_control: SecAccessControl,
) -> &mut Self
pub fn set_access_control( &mut self, access_control: SecAccessControl, ) -> &mut Self
Set access_control
Sourcepub fn to_dictionary(&self) -> CFDictionary
👎Deprecated: Pass the options to SecKey::new
pub fn to_dictionary(&self) -> CFDictionary
Collect options into a CFDictioanry
Trait Implementations§
Source§impl Default for GenerateKeyOptions
impl Default for GenerateKeyOptions
Source§fn default() -> GenerateKeyOptions
fn default() -> GenerateKeyOptions
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for GenerateKeyOptions
impl RefUnwindSafe for GenerateKeyOptions
impl !Send for GenerateKeyOptions
impl !Sync for GenerateKeyOptions
impl Unpin for GenerateKeyOptions
impl UnwindSafe for GenerateKeyOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more