Context
Object Hierarchy:
Description:
[ Compact ]
[ CCode ( cname = "struct gpgme_context" , cprefix = "gpgme_" , free_function = "gpgme_release" ) ]
public class Context
[ CCode ( cname = "struct gpgme_context" , cprefix = "gpgme_" , free_function = "gpgme_release" ) ]
public class Context
The Context object represents a GPG instance
Namespace: GPG
Package: gpgme
Content:
Static methods:
Methods:
- public bool get_armor ()
- public EngineInfo* get_engine_info ()
Get information about the configured engines. The returned data is valid until the next set_engine_info() call.
- public int get_include_certs ()
Return the number of certs to include in an S/MIME message
- public Error get_key (string fpr, out Key key, bool secret)
Get key with the fingerprint FPR from the crypto backend. If SECRET is true, get the secret key.
- public KeylistMode get_keylist_mode ()
- public void get_passphrase_cb (out passphrase_callback cb, out void* hook_value)
Get callback function and hook_value
- public Protocol get_protocol ()
- public bool get_textmode ()
- public Error op_decrypt (Data cipher, Data plain)
Decrypt ciphertext CIPHER and store the resulting plaintext in PLAIN.
- public DecryptResult* op_decrypt_result ()
Retrieve a pointer to the result of the decrypt operation
- public Error op_encrypt (Key[] recp, EncryptFlags flags, Data plain, Data cipher)
Encrypt plaintext PLAIN for the recipients RECP and store the resulting ciphertext in CIPHER.
- public EncryptResult* op_encrypt_result ()
Retrieve a pointer to the result of the encrypt operation
- public Error op_export (string? pattern, ExportMode mode, Data keydata)
Export the keys found by PATTERN into KEYDATA. If PATTERN is NULL all keys will be exported.
- public Error op_import (Data keydata)
Import the keys in KEYDATA.
- public unowned ImportResult op_import_result ()
Get result of last op_import.
- public Error op_keylist_end ()
ends a pending key list operation in the context.
- public Error op_keylist_next (out Key key)
returns the next key in the list created by a previous op_keylist_start() operation in the context ctx. The key will have one reference for the user.
- public KeylistResult op_keylist_result ()
The function op_keylist_result() returns a KeylistResult holding the result of a op_keylist_*() operation. The returned KeylistResult is only valid if the last operation on the context was a key listing operation, and if this operation finished successfully. The returned KeylistResult is only valid until the next operation is started on the context.
- public Error op_keylist_start (string? pattern = null, int secret_only = 0)
Initiates a key listing operation. It sets everything up, so that subsequent invocations of op_keylist_next() return the keys in the list.
- public Error op_sign (Data plain, Data sig, SigMode mode)
Sign the plaintext PLAIN and store the signature in SIG.
- public SignResult* op_sign_result ()
Retrieve a pointer to the results of the signing operation
- public Error op_verify (Data sig, Data signed_text, Data? plaintext)
Verify that SIG is a valid signature for SIGNED_TEXT.
- public VerifyResult* op_verify_result ()
Retrieve a pointer to the result of the verify operation
- public void set_armor (bool yes)
- public Error set_engine_info (Protocol proto, string file_name, string home_dir)
Set information about the configured engines. The string parameters may not be free'd after this calls, because they are not copied.
- public void set_include_certs (int nr_of_certs = -256)
Include up to nr_of_certs certificates in an S/MIME message, Use "-256" to use the backend's default.
- public Error set_keylist_mode (KeylistMode mode)
- public Error set_locale (int category, string val)
- public void set_passphrase_cb (passphrase_callback cb, void* hook_value = null)
Set callback function for requesting passphrase. hook_value will be passed as first argument.
- public Error set_protocol (Protocol p)
- public void set_textmode (bool yes)
- public Error sig_notation_add (string name, string val, SigNotationFlags flags)
Add human readable notation data. If name is null, then value val should be a policy URL. The HUMAN_READABLE flag is forced to be true for notation data and false for policy URLs.
- public void sig_notation_clear ()
Clear all notation data
- public SigNotation* sig_notation_get ()
Get sig notations
- public Error signers_add (Key key)
Add key to list of signers
- public void signers_clear ()
Delete all signers
- public unowned Key* signers_enum (int n)
Get the n-th signer's key
- public unowned Context* wait (out Error status, bool hang)
process the pending operation and, if hang is true, wait for the pending operation to finish.