Struct sequoia_autocrypt::AutocryptSetupMessage [−][src]
Holds an Autocrypt Setup Message.
An Autocrypt Setup Message is used to transfer a private key from one device to another.
Implementations
impl AutocryptSetupMessage
[src]
pub fn new(cert: Cert) -> Self
[src]
Creates a new Autocrypt Setup Message for the specified Cert
.
You can set the prefer_encrypt
setting, which defaults to
“nopreference”, using set_prefer_encrypt
.
Note: this generates a random passcode. To retrieve the
passcode, use the passcode
method.
To decode an Autocrypt Setup Message, use the from_bytes
or
from_reader
methods.
pub fn set_prefer_encrypt(self, value: &str) -> Self
[src]
Sets the prefer encrypt header.
pub fn prefer_encrypt(&self) -> Option<&str>
[src]
Returns the prefer encrypt header.
pub fn set_passcode_format(self, value: &str) -> Self
[src]
Sets the “Passcode-Format” header.
pub fn passcode_format(&self) -> Option<&str>
[src]
Returns the “Passcode-Format” header.
pub fn set_passcode(self, passcode: Password) -> Self
[src]
Sets the passcode.
pub fn passcode(&self) -> Option<&Password>
[src]
Returns the ASM’s passcode.
If the passcode has not yet been generated, this returns
None
.
pub fn set_passcode_begin(self, value: &str) -> Self
[src]
Sets the “Passcode-Begin” header.
pub fn passcode_begin(&self) -> Option<&str>
[src]
Returns the “Passcode-Begin” header.
pub fn serialize<W>(&mut self, w: &mut W) -> Result<()> where
W: Write + Send + Sync,
[src]
W: Write + Send + Sync,
Generates the Autocrypt Setup Message.
The message is written to w
.
pub fn from_bytes<'a>(
bytes: &'a [u8]
) -> Result<AutocryptSetupMessageParser<'a>>
[src]
bytes: &'a [u8]
) -> Result<AutocryptSetupMessageParser<'a>>
Parses the autocrypt setup message in r
.
passcode
is the passcode used to protect the message.
pub fn from_reader<'a, R: Read + Send + Sync + 'a>(
r: R
) -> Result<AutocryptSetupMessageParser<'a>>
[src]
r: R
) -> Result<AutocryptSetupMessageParser<'a>>
Parses the autocrypt setup message in r
.
passcode
is the passcode used to protect the message.
pub fn into_cert(self) -> Cert
[src]
Returns the Cert consuming the AutocryptSetupMessage
in the
process.
Trait Implementations
impl Debug for AutocryptSetupMessage
[src]
impl PartialEq<AutocryptSetupMessage> for AutocryptSetupMessage
[src]
fn eq(&self, other: &AutocryptSetupMessage) -> bool
[src]
fn ne(&self, other: &AutocryptSetupMessage) -> bool
[src]
impl StructuralPartialEq for AutocryptSetupMessage
[src]
Auto Trait Implementations
impl !RefUnwindSafe for AutocryptSetupMessage
impl Send for AutocryptSetupMessage
impl Sync for AutocryptSetupMessage
impl Unpin for AutocryptSetupMessage
impl !UnwindSafe for AutocryptSetupMessage
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,