Struct gpgme::context::Context [−][src]
#[must_use]pub struct Context(_);
A context for cryptographic operations
Methods
impl Context
[src]
impl Context
pub unsafe fn from_raw(raw: gpgme_ctx_t) -> Self
[src]
pub unsafe fn from_raw(raw: gpgme_ctx_t) -> Self
pub fn as_raw(&self) -> gpgme_ctx_t
[src]
pub fn as_raw(&self) -> gpgme_ctx_t
pub fn into_raw(self) -> gpgme_ctx_t
[src]
pub fn into_raw(self) -> gpgme_ctx_t
pub fn from_protocol(proto: Protocol) -> Result<Self>
[src]
pub fn from_protocol(proto: Protocol) -> Result<Self>
pub fn protocol(&self) -> Protocol
[src]
pub fn protocol(&self) -> Protocol
pub fn armor(&self) -> bool
[src]
pub fn armor(&self) -> bool
pub fn set_armor(&mut self, enabled: bool)
[src]
pub fn set_armor(&mut self, enabled: bool)
pub fn text_mode(&self) -> bool
[src]
pub fn text_mode(&self) -> bool
pub fn set_text_mode(&mut self, enabled: bool)
[src]
pub fn set_text_mode(&mut self, enabled: bool)
pub fn offline(&self) -> bool
[src]
pub fn offline(&self) -> bool
pub fn set_offline(&mut self, enabled: bool)
[src]
pub fn set_offline(&mut self, enabled: bool)
pub fn get_flag(
&self,
name: impl CStrArgument
) -> Result<&str, Option<Utf8Error>>
[src]
pub fn get_flag(
&self,
name: impl CStrArgument
) -> Result<&str, Option<Utf8Error>>
pub fn get_flag_raw(
&self,
name: impl CStrArgument
) -> Option<&CStr>
[src]
pub fn get_flag_raw(
&self,
name: impl CStrArgument
) -> Option<&CStr>
pub fn set_flag(
&mut self,
name: impl CStrArgument,
value: impl CStrArgument
) -> Result<()>
[src]
pub fn set_flag(
&mut self,
name: impl CStrArgument,
value: impl CStrArgument
) -> Result<()>
pub fn engine_info(&self) -> EngineInfo
[src]
pub fn engine_info(&self) -> EngineInfo
pub fn set_engine_path(
&mut self,
path: impl CStrArgument
) -> Result<()>
[src]
pub fn set_engine_path(
&mut self,
path: impl CStrArgument
) -> Result<()>
pub fn set_engine_home_dir(
&mut self,
home_dir: impl CStrArgument
) -> Result<()>
[src]
pub fn set_engine_home_dir(
&mut self,
home_dir: impl CStrArgument
) -> Result<()>
pub fn set_engine_info(
&mut self,
path: Option<impl CStrArgument>,
home_dir: Option<impl CStrArgument>
) -> Result<()>
[src]
pub fn set_engine_info(
&mut self,
path: Option<impl CStrArgument>,
home_dir: Option<impl CStrArgument>
) -> Result<()>
pub fn pinentry_mode(&self) -> PinentryMode
[src]
pub fn pinentry_mode(&self) -> PinentryMode
pub fn set_pinentry_mode(&mut self, mode: PinentryMode) -> Result<()>
[src]
pub fn set_pinentry_mode(&mut self, mode: PinentryMode) -> Result<()>
pub fn with_passphrase_provider<R, P>(
&mut self,
provider: P,
f: impl FnOnce(&mut Context) -> R
) -> R where
P: PassphraseProvider,
[src]
pub fn with_passphrase_provider<R, P>(
&mut self,
provider: P,
f: impl FnOnce(&mut Context) -> R
) -> R where
P: PassphraseProvider,
Uses the specified provider to handle passphrase requests for the duration of the closure.
Examples
use std::io::prelude::*; use gpgme::{Context, PassphraseRequest, Protocol}; let mut ctx = Context::from_protocol(Protocol::OpenPgp).unwrap(); ctx.with_passphrase_provider(|_: PassphraseRequest, out: &mut Write| { try!(out.write_all(b"some passphrase")); Ok(()) }, |mut ctx| { // Do something with ctx requiring a passphrase, for example decryption });
pub fn with_progress_handler<R, H>(
&mut self,
handler: H,
f: impl FnOnce(&mut Context) -> R
) -> R where
H: ProgressHandler,
[src]
pub fn with_progress_handler<R, H>(
&mut self,
handler: H,
f: impl FnOnce(&mut Context) -> R
) -> R where
H: ProgressHandler,
pub fn with_status_handler<R, H>(
&mut self,
handler: H,
f: impl FnOnce(&mut Context) -> R
) -> R where
H: StatusHandler,
[src]
pub fn with_status_handler<R, H>(
&mut self,
handler: H,
f: impl FnOnce(&mut Context) -> R
) -> R where
H: StatusHandler,
pub fn find_trust_items(
&mut self,
pattern: impl CStrArgument,
max_level: i32
) -> Result<TrustItems>
[src]
pub fn find_trust_items(
&mut self,
pattern: impl CStrArgument,
max_level: i32
) -> Result<TrustItems>
pub fn key_list_mode(&self) -> KeyListMode
[src]
pub fn key_list_mode(&self) -> KeyListMode
pub fn add_key_list_mode(&mut self, mask: KeyListMode) -> Result<()>
[src]
pub fn add_key_list_mode(&mut self, mask: KeyListMode) -> Result<()>
pub fn set_key_list_mode(&mut self, mode: KeyListMode) -> Result<()>
[src]
pub fn set_key_list_mode(&mut self, mode: KeyListMode) -> Result<()>
pub fn keys(&mut self) -> Result<Keys>
[src]
pub fn keys(&mut self) -> Result<Keys>
pub fn secret_keys(&mut self) -> Result<Keys>
[src]
pub fn secret_keys(&mut self) -> Result<Keys>
pub fn refresh_key(&mut self, key: &Key) -> Result<Key>
[src]
pub fn refresh_key(&mut self, key: &Key) -> Result<Key>
pub fn get_key(
&mut self,
fpr: impl CStrArgument
) -> Result<Key>
[src]
pub fn get_key(
&mut self,
fpr: impl CStrArgument
) -> Result<Key>
Returns the public key with the specified fingerprint, if such a key can be found. Otherwise, an error is returned.
pub fn get_secret_key(
&mut self,
fpr: impl CStrArgument
) -> Result<Key>
[src]
pub fn get_secret_key(
&mut self,
fpr: impl CStrArgument
) -> Result<Key>
Returns the secret key with the specified fingerprint, if such a key can be found. Otherwise, an error is returned.
pub fn find_key(
&mut self,
fpr: impl CStrArgument
) -> Result<Key>
[src]
pub fn find_key(
&mut self,
fpr: impl CStrArgument
) -> Result<Key>
: use get_key
instead
pub fn find_secret_key(
&mut self,
fpr: impl CStrArgument
) -> Result<Key>
[src]
pub fn find_secret_key(
&mut self,
fpr: impl CStrArgument
) -> Result<Key>
: use get_secret_key
instead
pub fn find_keys<I>(&mut self, patterns: I) -> Result<Keys> where
I: IntoIterator,
I::Item: CStrArgument,
[src]
pub fn find_keys<I>(&mut self, patterns: I) -> Result<Keys> where
I: IntoIterator,
I::Item: CStrArgument,
Returns an iterator for a list of all public keys matching one or more of the specified patterns.
pub fn find_secret_keys<I>(&mut self, patterns: I) -> Result<Keys> where
I: IntoIterator,
I::Item: CStrArgument,
[src]
pub fn find_secret_keys<I>(&mut self, patterns: I) -> Result<Keys> where
I: IntoIterator,
I::Item: CStrArgument,
Returns an iterator for a list of all secret keys matching one or more of the specified patterns.
pub fn read_keys<'d, D>(&mut self, src: D) -> Result<Keys<D::Output>> where
D: IntoData<'d>,
[src]
pub fn read_keys<'d, D>(&mut self, src: D) -> Result<Keys<D::Output>> where
D: IntoData<'d>,
Returns an iterator over the keys encoded in the specified source.
Examples
use gpgme::{Context, Data, Protocol}; let mut ctx = Context::from_protocol(Protocol::OpenPgp).unwrap(); let mut keyring = Data::load("somefile").unwrap(); for key in ctx.read_keys(&mut keyring).unwrap() { println!("{:?}", key); }
pub fn generate_key<'d1, 'd2, D1, D2>(
&mut self,
params: impl CStrArgument,
public: Option<D1>,
secret: Option<D2>
) -> Result<KeyGenerationResult> where
D1: IntoData<'d1>,
D2: IntoData<'d2>,
[src]
pub fn generate_key<'d1, 'd2, D1, D2>(
&mut self,
params: impl CStrArgument,
public: Option<D1>,
secret: Option<D2>
) -> Result<KeyGenerationResult> where
D1: IntoData<'d1>,
D2: IntoData<'d2>,
pub fn create_key(
&mut self,
userid: impl CStrArgument,
algo: impl CStrArgument,
expires: Option<SystemTime>
) -> Result<KeyGenerationResult>
[src]
pub fn create_key(
&mut self,
userid: impl CStrArgument,
algo: impl CStrArgument,
expires: Option<SystemTime>
) -> Result<KeyGenerationResult>
Creates a new OpenPGP key.
Examples
use gpgme::{Context, Data, Protocol}; let mut ctx = Context::from_protocol(Protocol::OpenPgp).unwrap(); let result = ctx.create_key("Example User <example@example.com>", "default", None).unwrap(); println!("Key Fingerprint: {}", result.fingerprint().unwrap());
pub fn create_key_with_flags(
&mut self,
userid: impl CStrArgument,
algo: impl CStrArgument,
expires: Option<SystemTime>,
flags: CreateKeyFlags
) -> Result<KeyGenerationResult>
[src]
pub fn create_key_with_flags(
&mut self,
userid: impl CStrArgument,
algo: impl CStrArgument,
expires: Option<SystemTime>,
flags: CreateKeyFlags
) -> Result<KeyGenerationResult>
pub fn create_subkey(
&mut self,
key: &Key,
algo: impl CStrArgument,
expires: Option<SystemTime>
) -> Result<KeyGenerationResult>
[src]
pub fn create_subkey(
&mut self,
key: &Key,
algo: impl CStrArgument,
expires: Option<SystemTime>
) -> Result<KeyGenerationResult>
pub fn create_subkey_with_flags(
&mut self,
key: &Key,
algo: impl CStrArgument,
expires: Option<SystemTime>,
flags: CreateKeyFlags
) -> Result<KeyGenerationResult>
[src]
pub fn create_subkey_with_flags(
&mut self,
key: &Key,
algo: impl CStrArgument,
expires: Option<SystemTime>,
flags: CreateKeyFlags
) -> Result<KeyGenerationResult>
pub fn add_uid(
&mut self,
key: &Key,
userid: impl CStrArgument
) -> Result<()>
[src]
pub fn add_uid(
&mut self,
key: &Key,
userid: impl CStrArgument
) -> Result<()>
pub fn revoke_uid(
&mut self,
key: &Key,
userid: impl CStrArgument
) -> Result<()>
[src]
pub fn revoke_uid(
&mut self,
key: &Key,
userid: impl CStrArgument
) -> Result<()>
pub fn set_uid_flag(
&mut self,
key: &Key,
userid: impl CStrArgument,
name: impl CStrArgument,
value: Option<impl CStrArgument>
) -> Result<()>
[src]
pub fn set_uid_flag(
&mut self,
key: &Key,
userid: impl CStrArgument,
name: impl CStrArgument,
value: Option<impl CStrArgument>
) -> Result<()>
pub fn sign_key<I>(
&mut self,
key: &Key,
userids: I,
expires: Option<SystemTime>
) -> Result<()> where
I: IntoIterator,
I::Item: AsRef<[u8]>,
[src]
pub fn sign_key<I>(
&mut self,
key: &Key,
userids: I,
expires: Option<SystemTime>
) -> Result<()> where
I: IntoIterator,
I::Item: AsRef<[u8]>,
Signs the given key with the default signing key, or the keys specified via
add_signer
.
pub fn sign_key_with_flags<I>(
&mut self,
key: &Key,
userids: I,
expires: Option<SystemTime>,
flags: KeySigningFlags
) -> Result<()> where
I: IntoIterator,
I::Item: AsRef<[u8]>,
[src]
pub fn sign_key_with_flags<I>(
&mut self,
key: &Key,
userids: I,
expires: Option<SystemTime>,
flags: KeySigningFlags
) -> Result<()> where
I: IntoIterator,
I::Item: AsRef<[u8]>,
pub fn change_key_tofu_policy(
&mut self,
key: &Key,
policy: TofuPolicy
) -> Result<()>
[src]
pub fn change_key_tofu_policy(
&mut self,
key: &Key,
policy: TofuPolicy
) -> Result<()>
pub fn change_key_passphrase(&mut self, key: &Key) -> Result<()>
[src]
pub fn change_key_passphrase(&mut self, key: &Key) -> Result<()>
pub fn edit_key<'a, E, D>(
&mut self,
key: &Key,
interactor: E,
data: D
) -> Result<()> where
E: EditInteractor,
D: IntoData<'a>,
[src]
pub fn edit_key<'a, E, D>(
&mut self,
key: &Key,
interactor: E,
data: D
) -> Result<()> where
E: EditInteractor,
D: IntoData<'a>,
pub fn edit_card_key<'a, E, D>(
&mut self,
key: &Key,
interactor: E,
data: D
) -> Result<()> where
E: EditInteractor,
D: IntoData<'a>,
[src]
pub fn edit_card_key<'a, E, D>(
&mut self,
key: &Key,
interactor: E,
data: D
) -> Result<()> where
E: EditInteractor,
D: IntoData<'a>,
pub fn edit_key_with<'a, D>(
&mut self,
key: &Key,
editor: impl Editor,
data: D
) -> Result<()> where
D: IntoData<'a>,
[src]
pub fn edit_key_with<'a, D>(
&mut self,
key: &Key,
editor: impl Editor,
data: D
) -> Result<()> where
D: IntoData<'a>,
pub fn edit_card_key_with<'a, D>(
&mut self,
key: &Key,
editor: impl Editor,
data: D
) -> Result<()> where
D: IntoData<'a>,
[src]
pub fn edit_card_key_with<'a, D>(
&mut self,
key: &Key,
editor: impl Editor,
data: D
) -> Result<()> where
D: IntoData<'a>,
pub fn interact<'a, I, D>(
&mut self,
key: &Key,
interactor: I,
data: D
) -> Result<()> where
I: Interactor,
D: IntoData<'a>,
[src]
pub fn interact<'a, I, D>(
&mut self,
key: &Key,
interactor: I,
data: D
) -> Result<()> where
I: Interactor,
D: IntoData<'a>,
pub fn interact_with_card<'a, I, D>(
&mut self,
key: &Key,
interactor: I,
data: D
) -> Result<()> where
I: Interactor,
D: IntoData<'a>,
[src]
pub fn interact_with_card<'a, I, D>(
&mut self,
key: &Key,
interactor: I,
data: D
) -> Result<()> where
I: Interactor,
D: IntoData<'a>,
pub fn delete_key(&mut self, key: &Key) -> Result<()>
[src]
pub fn delete_key(&mut self, key: &Key) -> Result<()>
pub fn delete_secret_key(&mut self, key: &Key) -> Result<()>
[src]
pub fn delete_secret_key(&mut self, key: &Key) -> Result<()>
pub fn delete_key_with_flags(
&mut self,
key: &Key,
flags: DeleteKeyFlags
) -> Result<()>
[src]
pub fn delete_key_with_flags(
&mut self,
key: &Key,
flags: DeleteKeyFlags
) -> Result<()>
pub fn import<'a, D>(&mut self, src: D) -> Result<ImportResult> where
D: IntoData<'a>,
[src]
pub fn import<'a, D>(&mut self, src: D) -> Result<ImportResult> where
D: IntoData<'a>,
pub fn import_keys<'k, I>(&mut self, keys: I) -> Result<ImportResult> where
I: IntoIterator<Item = &'k Key>,
[src]
pub fn import_keys<'k, I>(&mut self, keys: I) -> Result<ImportResult> where
I: IntoIterator<Item = &'k Key>,
pub fn export_all_extern<I>(&mut self, mode: ExportMode) -> Result<()> where
I: IntoIterator,
I::Item: CStrArgument,
[src]
pub fn export_all_extern<I>(&mut self, mode: ExportMode) -> Result<()> where
I: IntoIterator,
I::Item: CStrArgument,
pub fn export_extern<I>(&mut self, patterns: I, mode: ExportMode) -> Result<()> where
I: IntoIterator,
I::Item: CStrArgument,
[src]
pub fn export_extern<I>(&mut self, patterns: I, mode: ExportMode) -> Result<()> where
I: IntoIterator,
I::Item: CStrArgument,
pub fn export_all<'a, D>(&mut self, mode: ExportMode, dst: D) -> Result<()> where
D: IntoData<'a>,
[src]
pub fn export_all<'a, D>(&mut self, mode: ExportMode, dst: D) -> Result<()> where
D: IntoData<'a>,
pub fn export<'a, I, D>(
&mut self,
patterns: I,
mode: ExportMode,
dst: D
) -> Result<()> where
I: IntoIterator,
I::Item: CStrArgument,
D: IntoData<'a>,
[src]
pub fn export<'a, I, D>(
&mut self,
patterns: I,
mode: ExportMode,
dst: D
) -> Result<()> where
I: IntoIterator,
I::Item: CStrArgument,
D: IntoData<'a>,
pub fn export_keys_extern<'k, I>(
&mut self,
keys: I,
mode: ExportMode
) -> Result<()> where
I: IntoIterator<Item = &'k Key>,
[src]
pub fn export_keys_extern<'k, I>(
&mut self,
keys: I,
mode: ExportMode
) -> Result<()> where
I: IntoIterator<Item = &'k Key>,
pub fn export_keys<'k, 'a, I, D>(
&mut self,
keys: I,
mode: ExportMode,
dst: D
) -> Result<()> where
I: IntoIterator<Item = &'k Key>,
D: IntoData<'a>,
[src]
pub fn export_keys<'k, 'a, I, D>(
&mut self,
keys: I,
mode: ExportMode,
dst: D
) -> Result<()> where
I: IntoIterator<Item = &'k Key>,
D: IntoData<'a>,
pub fn clear_sender(&mut self) -> Result<()>
[src]
pub fn clear_sender(&mut self) -> Result<()>
pub fn set_sender(
&mut self,
sender: impl CStrArgument
) -> Result<()>
[src]
pub fn set_sender(
&mut self,
sender: impl CStrArgument
) -> Result<()>
pub fn sender(&self) -> Result<&str, Option<Utf8Error>>
[src]
pub fn sender(&self) -> Result<&str, Option<Utf8Error>>
pub fn sender_raw(&self) -> Option<&CStr>
[src]
pub fn sender_raw(&self) -> Option<&CStr>
pub fn clear_signers(&mut self)
[src]
pub fn clear_signers(&mut self)
pub fn add_signer(&mut self, key: &Key) -> Result<()>
[src]
pub fn add_signer(&mut self, key: &Key) -> Result<()>
ⓘImportant traits for Signers<'ctx>pub fn signers(&self) -> Signers
[src]
pub fn signers(&self) -> Signers
pub fn clear_signature_notations(&mut self)
[src]
pub fn clear_signature_notations(&mut self)
pub fn add_signature_notation(
&mut self,
name: impl CStrArgument,
value: impl CStrArgument,
flags: SignatureNotationFlags
) -> Result<()>
[src]
pub fn add_signature_notation(
&mut self,
name: impl CStrArgument,
value: impl CStrArgument,
flags: SignatureNotationFlags
) -> Result<()>
pub fn add_signature_policy_url(
&mut self,
url: impl CStrArgument,
critical: bool
) -> Result<()>
[src]
pub fn add_signature_policy_url(
&mut self,
url: impl CStrArgument,
critical: bool
) -> Result<()>
pub fn signature_policy_url(&self) -> Result<&str, Option<Utf8Error>>
[src]
pub fn signature_policy_url(&self) -> Result<&str, Option<Utf8Error>>
pub fn signature_policy_url_raw(&self) -> Option<&CStr>
[src]
pub fn signature_policy_url_raw(&self) -> Option<&CStr>
ⓘImportant traits for SignatureNotations<'a>pub fn signature_notations(&self) -> SignatureNotations
[src]
pub fn signature_notations(&self) -> SignatureNotations
pub fn sign_clear<'p, 't, P, T>(
&mut self,
plaintext: P,
signedtext: T
) -> Result<SigningResult> where
P: IntoData<'p>,
T: IntoData<'t>,
[src]
pub fn sign_clear<'p, 't, P, T>(
&mut self,
plaintext: P,
signedtext: T
) -> Result<SigningResult> where
P: IntoData<'p>,
T: IntoData<'t>,
pub fn sign_detached<'p, 's, P, S>(
&mut self,
plaintext: P,
signature: S
) -> Result<SigningResult> where
P: IntoData<'p>,
S: IntoData<'s>,
[src]
pub fn sign_detached<'p, 's, P, S>(
&mut self,
plaintext: P,
signature: S
) -> Result<SigningResult> where
P: IntoData<'p>,
S: IntoData<'s>,
pub fn sign_normal<'p, 't, P, T>(
&mut self,
plaintext: P,
signedtext: T
) -> Result<SigningResult> where
P: IntoData<'p>,
T: IntoData<'t>,
[src]
pub fn sign_normal<'p, 't, P, T>(
&mut self,
plaintext: P,
signedtext: T
) -> Result<SigningResult> where
P: IntoData<'p>,
T: IntoData<'t>,
pub fn sign<'p, 's, P, S>(
&mut self,
mode: SignMode,
plaintext: P,
signature: S
) -> Result<SigningResult> where
P: IntoData<'p>,
S: IntoData<'s>,
[src]
pub fn sign<'p, 's, P, S>(
&mut self,
mode: SignMode,
plaintext: P,
signature: S
) -> Result<SigningResult> where
P: IntoData<'p>,
S: IntoData<'s>,
pub fn verify_detached<'s, 't, S, T>(
&mut self,
signature: S,
signedtext: T
) -> Result<VerificationResult> where
S: IntoData<'s>,
T: IntoData<'t>,
[src]
pub fn verify_detached<'s, 't, S, T>(
&mut self,
signature: S,
signedtext: T
) -> Result<VerificationResult> where
S: IntoData<'s>,
T: IntoData<'t>,
pub fn verify_opaque<'s, 'p, S, P>(
&mut self,
signedtext: S,
plaintext: P
) -> Result<VerificationResult> where
S: IntoData<'s>,
P: IntoData<'p>,
[src]
pub fn verify_opaque<'s, 'p, S, P>(
&mut self,
signedtext: S,
plaintext: P
) -> Result<VerificationResult> where
S: IntoData<'s>,
P: IntoData<'p>,
pub fn encrypt<'k, 'p, 'c, I, P, C>(
&mut self,
recp: I,
plaintext: P,
ciphertext: C
) -> Result<EncryptionResult> where
I: IntoIterator<Item = &'k Key>,
P: IntoData<'p>,
C: IntoData<'c>,
[src]
pub fn encrypt<'k, 'p, 'c, I, P, C>(
&mut self,
recp: I,
plaintext: P,
ciphertext: C
) -> Result<EncryptionResult> where
I: IntoIterator<Item = &'k Key>,
P: IntoData<'p>,
C: IntoData<'c>,
Encrypts a message for the specified recipients.
Examples
use gpgme::{Context, Data, Protocol}; let mut ctx = Context::from_protocol(Protocol::OpenPgp).unwrap(); let key = ctx.find_key("[some key fingerprint]").unwrap(); let (plaintext, mut ciphertext) = ("Hello, World!", Vec::new()); ctx.encrypt(Some(&key), plaintext, &mut ciphertext).unwrap();
pub fn encrypt_with_flags<'k, 'p, 'c, I, P, C>(
&mut self,
recp: I,
plaintext: P,
ciphertext: C,
flags: EncryptFlags
) -> Result<EncryptionResult> where
I: IntoIterator<Item = &'k Key>,
P: IntoData<'p>,
C: IntoData<'c>,
[src]
pub fn encrypt_with_flags<'k, 'p, 'c, I, P, C>(
&mut self,
recp: I,
plaintext: P,
ciphertext: C,
flags: EncryptFlags
) -> Result<EncryptionResult> where
I: IntoIterator<Item = &'k Key>,
P: IntoData<'p>,
C: IntoData<'c>,
pub fn encrypt_symmetric<'p, 'c, P, C>(
&mut self,
plaintext: P,
ciphertext: C
) -> Result<()> where
P: IntoData<'p>,
C: IntoData<'c>,
[src]
pub fn encrypt_symmetric<'p, 'c, P, C>(
&mut self,
plaintext: P,
ciphertext: C
) -> Result<()> where
P: IntoData<'p>,
C: IntoData<'c>,
pub fn encrypt_symmetric_with_flags<'p, 'c, P, C>(
&mut self,
plaintext: P,
ciphertext: C,
flags: EncryptFlags
) -> Result<()> where
P: IntoData<'p>,
C: IntoData<'c>,
[src]
pub fn encrypt_symmetric_with_flags<'p, 'c, P, C>(
&mut self,
plaintext: P,
ciphertext: C,
flags: EncryptFlags
) -> Result<()> where
P: IntoData<'p>,
C: IntoData<'c>,
pub fn sign_and_encrypt<'k, 'p, 'c, I, P, C>(
&mut self,
recp: I,
plaintext: P,
ciphertext: C
) -> Result<(EncryptionResult, SigningResult)> where
I: IntoIterator<Item = &'k Key>,
P: IntoData<'p>,
C: IntoData<'c>,
[src]
pub fn sign_and_encrypt<'k, 'p, 'c, I, P, C>(
&mut self,
recp: I,
plaintext: P,
ciphertext: C
) -> Result<(EncryptionResult, SigningResult)> where
I: IntoIterator<Item = &'k Key>,
P: IntoData<'p>,
C: IntoData<'c>,
Encrypts and signs a message for the specified recipients.
Examples
use gpgme::{Context, Protocol}; let mut ctx = Context::from_protocol(Protocol::OpenPgp).unwrap(); let key = ctx.find_key("[some key fingerprint]").unwrap(); let (plaintext, mut ciphertext) = ("Hello, World!", Vec::new()); ctx.sign_and_encrypt(Some(&key), plaintext, &mut ciphertext).unwrap();
pub fn sign_and_encrypt_with_flags<'k, 'p, 'c, I, P, C>(
&mut self,
recp: I,
plaintext: P,
ciphertext: C,
flags: EncryptFlags
) -> Result<(EncryptionResult, SigningResult)> where
I: IntoIterator<Item = &'k Key>,
P: IntoData<'p>,
C: IntoData<'c>,
[src]
pub fn sign_and_encrypt_with_flags<'k, 'p, 'c, I, P, C>(
&mut self,
recp: I,
plaintext: P,
ciphertext: C,
flags: EncryptFlags
) -> Result<(EncryptionResult, SigningResult)> where
I: IntoIterator<Item = &'k Key>,
P: IntoData<'p>,
C: IntoData<'c>,
pub fn decrypt<'c, 'p, C, P>(
&mut self,
ciphertext: C,
plaintext: P
) -> Result<DecryptionResult> where
C: IntoData<'c>,
P: IntoData<'p>,
[src]
pub fn decrypt<'c, 'p, C, P>(
&mut self,
ciphertext: C,
plaintext: P
) -> Result<DecryptionResult> where
C: IntoData<'c>,
P: IntoData<'p>,
Decrypts a message.
Examples
use gpgme::{Context, Data, Protocol}; let mut ctx = Context::from_protocol(Protocol::OpenPgp).unwrap(); let mut cipher = Data::load("some file").unwrap(); let mut plain = Vec::new(); ctx.decrypt(&mut cipher, &mut plain).unwrap();
pub fn decrypt_with_flags<'c, 'p, C, P>(
&mut self,
ciphertext: C,
plaintext: P,
flags: DecryptFlags
) -> Result<DecryptionResult> where
C: IntoData<'c>,
P: IntoData<'p>,
[src]
pub fn decrypt_with_flags<'c, 'p, C, P>(
&mut self,
ciphertext: C,
plaintext: P,
flags: DecryptFlags
) -> Result<DecryptionResult> where
C: IntoData<'c>,
P: IntoData<'p>,
pub fn decrypt_and_verify<'c, 'p, C, P>(
&mut self,
ciphertext: C,
plaintext: P
) -> Result<(DecryptionResult, VerificationResult)> where
C: IntoData<'c>,
P: IntoData<'p>,
[src]
pub fn decrypt_and_verify<'c, 'p, C, P>(
&mut self,
ciphertext: C,
plaintext: P
) -> Result<(DecryptionResult, VerificationResult)> where
C: IntoData<'c>,
P: IntoData<'p>,
Decrypts and verifies a message.
Examples
use gpgme::{Context, Data, Protocol}; let mut ctx = Context::from_protocol(Protocol::OpenPgp).unwrap(); let mut cipher = Data::load("some file").unwrap(); let mut plain = Vec::new(); ctx.decrypt_and_verify(&mut cipher, &mut plain).unwrap();
pub fn decrypt_and_verify_with_flags<'c, 'p, C, P>(
&mut self,
ciphertext: C,
plaintext: P,
flags: DecryptFlags
) -> Result<(DecryptionResult, VerificationResult)> where
C: IntoData<'c>,
P: IntoData<'p>,
[src]
pub fn decrypt_and_verify_with_flags<'c, 'p, C, P>(
&mut self,
ciphertext: C,
plaintext: P,
flags: DecryptFlags
) -> Result<(DecryptionResult, VerificationResult)> where
C: IntoData<'c>,
P: IntoData<'p>,
pub fn query_swdb(
&mut self,
name: Option<impl CStrArgument>,
installed_ver: Option<impl CStrArgument>
) -> Result<QuerySwdbResult>
[src]
pub fn query_swdb(
&mut self,
name: Option<impl CStrArgument>,
installed_ver: Option<impl CStrArgument>
) -> Result<QuerySwdbResult>
pub fn get_audit_log<'a, D>(
&mut self,
dst: D,
flags: AuditLogFlags
) -> Result<()> where
D: IntoData<'a>,
[src]
pub fn get_audit_log<'a, D>(
&mut self,
dst: D,
flags: AuditLogFlags
) -> Result<()> where
D: IntoData<'a>,