Struct sequoia_autocrypt::AutocryptSetupMessage[][src]

pub struct AutocryptSetupMessage { /* fields omitted */ }

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]

Generates the Autocrypt Setup Message.

The message is written to w.

pub fn from_bytes<'a>(
    bytes: &'a [u8]
) -> Result<AutocryptSetupMessageParser<'a>>
[src]

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]

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]

impl StructuralPartialEq for AutocryptSetupMessage[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

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]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.