pub struct IdentityFile<C>where
C: Callbacks,{ /* private fields */ }Expand description
A list of identities that has been parsed from some input file.
Implementations§
Source§impl IdentityFile<NoCallbacks>
impl IdentityFile<NoCallbacks>
Sourcepub fn from_file(filename: String) -> Result<IdentityFile<NoCallbacks>, Error>
pub fn from_file(filename: String) -> Result<IdentityFile<NoCallbacks>, Error>
Parses one or more identities from a file containing valid UTF-8.
Sourcepub fn from_buffer<R>(data: R) -> Result<IdentityFile<NoCallbacks>, Error>where
R: BufRead,
pub fn from_buffer<R>(data: R) -> Result<IdentityFile<NoCallbacks>, Error>where
R: BufRead,
Parses one or more identities from a buffered input containing valid UTF-8.
Sourcepub fn from_input_reader(
reader: InputReader,
) -> Result<IdentityFile<NoCallbacks>, Error>
pub fn from_input_reader( reader: InputReader, ) -> Result<IdentityFile<NoCallbacks>, Error>
Parses one or more identities from an InputReader;
Source§impl<C> IdentityFile<C>where
C: Callbacks,
impl<C> IdentityFile<C>where
C: Callbacks,
Sourcepub fn with_callbacks<D>(self, callbacks: D) -> IdentityFile<D>where
D: Callbacks,
pub fn with_callbacks<D>(self, callbacks: D) -> IdentityFile<D>where
D: Callbacks,
Sets the provided callbacks on this identity file, so that if this is an encrypted identity, it can potentially be decrypted.
Sourcepub fn write_recipients_file<W>(
&self,
output: W,
) -> Result<(), IdentityFileConvertError>where
W: Write,
pub fn write_recipients_file<W>(
&self,
output: W,
) -> Result<(), IdentityFileConvertError>where
W: Write,
Writes a recipients file containing the recipients corresponding to the identities in this file.
Returns an error if this file is empty, or if it contains plugin identities (which can only be converted by the plugin binary itself).
Sourcepub fn to_recipients(
&self,
) -> Result<Vec<Box<dyn Recipient + Send>>, EncryptError>
pub fn to_recipients( &self, ) -> Result<Vec<Box<dyn Recipient + Send>>, EncryptError>
Returns recipients for the identities in this file.
Plugin identities will be merged into one Recipient per unique plugin.
Sourcepub fn into_identities(
self,
) -> Result<Vec<Box<dyn Identity + Sync + Send>>, DecryptError>
pub fn into_identities( self, ) -> Result<Vec<Box<dyn Identity + Sync + Send>>, DecryptError>
Returns the identities in this file.