security_framework::os::macos::import_export

Struct ImportOptions

Source
pub struct ImportOptions<'a> { /* private fields */ }
Expand description

A builder type to import Security Framework types from serialized formats.

Implementations§

Source§

impl<'a> ImportOptions<'a>

Source

pub fn new() -> ImportOptions<'a>

Creates a new builder with default options.

Source

pub fn filename(&mut self, filename: &str) -> &mut ImportOptions<'a>

Sets the filename from which the imported data came.

The extension of the file will used as a hint for parsing.

Source

pub fn passphrase(&mut self, passphrase: &str) -> &mut ImportOptions<'a>

Sets the passphrase to be used to decrypt the imported data.

Source

pub fn passphrase_bytes(&mut self, passphrase: &[u8]) -> &mut ImportOptions<'a>

Sets the passphrase to be used to decrypt the imported data.

Source

pub fn secure_passphrase( &mut self, secure_passphrase: bool, ) -> &mut ImportOptions<'a>

If set, the user will be prompted to imput the passphrase used to decrypt the imported data.

Source

pub fn no_access_control( &mut self, no_access_control: bool, ) -> &mut ImportOptions<'a>

If set, imported items will have no access controls imposed on them.

Source

pub fn alert_title(&mut self, alert_title: &str) -> &mut ImportOptions<'a>

Sets the title of the alert popup used with the secure_passphrase option.

Source

pub fn alert_prompt(&mut self, alert_prompt: &str) -> &mut ImportOptions<'a>

Sets the prompt of the alert popup used with the secure_passphrase option.

Source

pub fn items(&mut self, items: &'a mut SecItems) -> &mut ImportOptions<'a>

Sets the object into which imported items will be placed.

Source

pub fn keychain(&mut self, keychain: &SecKeychain) -> &mut ImportOptions<'a>

Sets the keychain into which items will be imported.

This must be specified to import SecIdentitys.

Source

pub fn import(&mut self, data: &[u8]) -> Result<()>

Imports items from serialized data.

Trait Implementations§

Source§

impl<'a> Default for ImportOptions<'a>

Source§

fn default() -> ImportOptions<'a>

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for ImportOptions<'a>

§

impl<'a> RefUnwindSafe for ImportOptions<'a>

§

impl<'a> !Send for ImportOptions<'a>

§

impl<'a> !Sync for ImportOptions<'a>

§

impl<'a> Unpin for ImportOptions<'a>

§

impl<'a> !UnwindSafe for ImportOptions<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.