Trait sop::ops::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§