Trait Encrypt

Source
pub trait Encrypt<'s, S: SOP<'s>, Certs: Load<'s, S>, Keys: Load<'s, S>> {
    // Required methods
    fn no_armor(self: Box<Self>) -> Box<dyn Encrypt<'s, S, Certs, Keys> + 's>;
    fn mode(
        self: Box<Self>,
        mode: EncryptAs,
    ) -> Box<dyn Encrypt<'s, S, Certs, Keys> + 's>;
    fn sign_with_keys(
        self: Box<Self>,
        keys: &Keys,
    ) -> Result<Box<dyn Encrypt<'s, S, Certs, Keys> + 's>>;
    fn with_key_password(
        self: Box<Self>,
        password: Password,
    ) -> Result<Box<dyn Encrypt<'s, S, Certs, Keys> + 's>>;
    fn with_password(
        self: Box<Self>,
        password: Password,
    ) -> Result<Box<dyn Encrypt<'s, S, Certs, Keys> + 's>>;
    fn with_certs(
        self: Box<Self>,
        certs: &Certs,
    ) -> Result<Box<dyn Encrypt<'s, S, Certs, Keys> + 's>>;
    fn plaintext<'d>(
        self: Box<Self>,
        plaintext: &'d mut (dyn Read + Send + Sync),
    ) -> Result<Box<dyn Ready<Option<SessionKey>> + 'd>>
       where 's: 'd;

    // Provided methods
    fn list_profiles(&self) -> Vec<(String, String)> { ... }
    fn profile(
        self: Box<Self>,
        _profile: &str,
    ) -> Result<Box<dyn Encrypt<'s, S, Certs, Keys> + 's>> { ... }
}
Expand description

Builder for SOP::encrypt.

Required Methods§

Source

fn no_armor(self: Box<Self>) -> Box<dyn Encrypt<'s, S, Certs, Keys> + 's>

Disables armor encoding.

Source

fn mode( self: Box<Self>, mode: EncryptAs, ) -> Box<dyn Encrypt<'s, S, Certs, Keys> + 's>

Sets encryption mode.

Source

fn sign_with_keys( self: Box<Self>, keys: &Keys, ) -> Result<Box<dyn Encrypt<'s, S, Certs, Keys> + 's>>

Adds the signer keys.

Source

fn with_key_password( self: Box<Self>, password: Password, ) -> Result<Box<dyn Encrypt<'s, S, Certs, Keys> + 's>>

Adds a password to unlock the signing keys with.

All supplied passwords will be used to try to unlock all signing keys.

Source

fn with_password( self: Box<Self>, password: Password, ) -> Result<Box<dyn Encrypt<'s, S, Certs, Keys> + 's>>

Encrypts with the given password.

Source

fn with_certs( self: Box<Self>, certs: &Certs, ) -> Result<Box<dyn Encrypt<'s, S, Certs, Keys> + 's>>

Encrypts with the given certs.

Source

fn plaintext<'d>( self: Box<Self>, plaintext: &'d mut (dyn Read + Send + Sync), ) -> Result<Box<dyn Ready<Option<SessionKey>> + 'd>>
where 's: 'd,

Encrypts the given data yielding the ciphertext.

Provided Methods§

Source

fn list_profiles(&self) -> Vec<(String, String)>

Lists profiles for this subcommand.

Source

fn profile( self: Box<Self>, _profile: &str, ) -> Result<Box<dyn Encrypt<'s, S, Certs, Keys> + 's>>

Selects a profile for this subcommand.

Valid profiles can be queried using GenerateKey::list_profiles.

Implementors§