pub struct Context { /* private fields */ }
Expand description
GnuPG binary context.
Trait Implementations
sourceimpl IsContext for Context
impl IsContext for Context
sourcefn encrypt(
&mut self,
recipients: &Recipients,
plaintext: Plaintext
) -> Result<Ciphertext>
fn encrypt(
&mut self,
recipients: &Recipients,
plaintext: Plaintext
) -> Result<Ciphertext>
Encrypt plaintext for recipients.
sourcefn decrypt(&mut self, ciphertext: Ciphertext) -> Result<Plaintext>
fn decrypt(&mut self, ciphertext: Ciphertext) -> Result<Plaintext>
Decrypt ciphertext.
sourcefn can_decrypt(&mut self, ciphertext: Ciphertext) -> Result<bool>
fn can_decrypt(&mut self, ciphertext: Ciphertext) -> Result<bool>
Check whether we can decrypt ciphertext.
sourcefn keys_public(&mut self) -> Result<Vec<Key>>
fn keys_public(&mut self) -> Result<Vec<Key>>
Obtain all public keys from keychain.
sourcefn keys_private(&mut self) -> Result<Vec<Key>>
fn keys_private(&mut self) -> Result<Vec<Key>>
Obtain all public keys from keychain.
sourcefn import_key(&mut self, key: &[u8]) -> Result<()>
fn import_key(&mut self, key: &[u8]) -> Result<()>
Import the given key from bytes into keychain.
sourcefn export_key(&mut self, key: Key) -> Result<Vec<u8>>
fn export_key(&mut self, key: Key) -> Result<Vec<u8>>
Export the given key from the keychain as bytes.
sourcefn supports_proto(&self, proto: Proto) -> bool
fn supports_proto(&self, proto: Proto) -> bool
Check whether this context supports the given protocol.
sourcefn encrypt_file(
&mut self,
recipients: &Recipients,
plaintext: Plaintext,
path: &Path
) -> Result<()>
fn encrypt_file(
&mut self,
recipients: &Recipients,
plaintext: Plaintext,
path: &Path
) -> Result<()>
Encrypt plaintext and write it to the file.
sourcefn decrypt_file(&mut self, path: &Path) -> Result<Plaintext>
fn decrypt_file(&mut self, path: &Path) -> Result<Plaintext>
Decrypt ciphertext from file.
sourcefn can_decrypt_file(&mut self, path: &Path) -> Result<bool>
fn can_decrypt_file(&mut self, path: &Path) -> Result<bool>
Check whether we can decrypt ciphertext from file.
sourcefn get_public_key(&mut self, fingerprint: &str) -> Result<Key>
fn get_public_key(&mut self, fingerprint: &str) -> Result<Key>
Obtain a public key from keychain for fingerprint.
sourcefn find_public_keys(&mut self, fingerprints: &[&str]) -> Result<Vec<Key>>
fn find_public_keys(&mut self, fingerprints: &[&str]) -> Result<Vec<Key>>
Find public keys from keychain for fingerprints. Read more
sourcefn import_key_file(&mut self, path: &Path) -> Result<()>
fn import_key_file(&mut self, path: &Path) -> Result<()>
Import the given key from a file into keychain.
Auto Trait Implementations
impl RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl UnwindSafe for Context
Blanket Implementations
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Src where
Scheme: ApproxScheme,
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Src where
Scheme: ApproxScheme,
type Err = NoError
type Err = NoError
The error type produced by a failed conversion.
fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
Convert the given value into an approximately equivalent representation.
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Src where
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Src where
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
The error type produced by a failed conversion.
fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
Convert the subject into an approximately equivalent representation.
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> ConvUtil for T
impl<T> ConvUtil for T
fn approx_as<Dst>(self) -> Result<Dst, Self::Err> where
Self: ApproxInto<Dst, DefaultApprox>,
fn approx_as<Dst>(self) -> Result<Dst, Self::Err> where
Self: ApproxInto<Dst, DefaultApprox>,
Approximate the subject to a given type with the default scheme.
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err> where
Self: ApproxInto<Dst, Scheme>,
Scheme: ApproxScheme,
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err> where
Self: ApproxInto<Dst, Scheme>,
Scheme: ApproxScheme,
Approximate the subject to a given type with a specific scheme.
impl<Src> ValueFrom<Src> for Src
impl<Src> ValueFrom<Src> for Src
type Err = NoError
type Err = NoError
The error type produced by a failed conversion.
fn value_from(src: Src) -> Result<Src, <Src as ValueFrom<Src>>::Err>
fn value_from(src: Src) -> Result<Src, <Src as ValueFrom<Src>>::Err>
Convert the given value into an exactly equivalent representation.
impl<Src, Dst> ValueInto<Dst> for Src where
Dst: ValueFrom<Src>,
impl<Src, Dst> ValueInto<Dst> for Src where
Dst: ValueFrom<Src>,
type Err = <Dst as ValueFrom<Src>>::Err
type Err = <Dst as ValueFrom<Src>>::Err
The error type produced by a failed conversion.
fn value_into(self) -> Result<Dst, <Src as ValueInto<Dst>>::Err>
fn value_into(self) -> Result<Dst, <Src as ValueInto<Dst>>::Err>
Convert the subject into an exactly equivalent representation.