[][src]Struct sequoia_openpgp::autocrypt::AutocryptSetupMessage

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.

Methods

impl AutocryptSetupMessage[src]

pub fn new(tpk: TPK) -> Self[src]

Creates a new Autocrypt Setup Message for the specified TPK.

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: Write>(&mut self, w: &mut W) -> Result<()>[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 + '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_tpk(self) -> TPK[src]

Returns the TPK consuming the AutocryptSetupMessage in the process.

Trait Implementations

impl PartialEq<AutocryptSetupMessage> for AutocryptSetupMessage[src]

impl Debug for AutocryptSetupMessage[src]

Auto Trait Implementations

Blanket Implementations

impl<T> From for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

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

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

The type returned in the event of a conversion error.

impl<V, T> VZip for T where
    V: MultiLane<T>,