GMimeGpgContext

## GMimeGpgContext GMimeGpgContext — GnuPG crypto contexts |

## Functions

GMimeCryptoContext * | g_mime_gpg_context_new ()
gboolean | g_mime_gpg_context_get_always_trust ()
void | g_mime_gpg_context_set_always_trust ()
gboolean | g_mime_gpg_context_get_auto_key_retrieve ()
void | g_mime_gpg_context_set_auto_key_retrieve ()
gboolean | g_mime_gpg_context_get_use_agent ()
void | g_mime_gpg_context_set_use_agent ()

## Types and Values

struct | GMimeGpgContext

## Description

A GMimeGpgContext is a GMimeCryptoContext that uses GnuPG to do all of the encryption and digital signatures.

## Functions

### g_mime_gpg_context_new ()

    GMimeCryptoContext *
    g_mime_gpg_context_new (GMimePasswordRequestFunc request_passwd,
                            const char *path);

Creates a new gpg crypto context object.

#### Parameters

request_passwd | a GMimePasswordRequestFunc |
path | path to gpg binary or `NULL` for the default |

#### Returns

a new gpg crypto context object.

[transfer full]

### g_mime_gpg_context_get_always_trust ()

    gboolean
    g_mime_gpg_context_get_always_trust (GMimeGpgContext *ctx);

Gets whther or not gpg should always trust keys when encrypting.

#### Parameters

ctx | a GMimeGpgContext |

#### Returns

`TRUE` if gpg should always trust keys when encrypting or `FALSE` otherwise.

### g_mime_gpg_context_set_always_trust ()

    void
    g_mime_gpg_context_set_always_trust (GMimeGpgContext *ctx,
                                         gboolean always_trust);

Sets whether or not gpg should always trust keys when encrypting.

#### Parameters

ctx | a GMimeGpgContext |
always_trust | `TRUE` if gpg should always trust keys when encrypting |

### g_mime_gpg_context_get_auto_key_retrieve ()

    gboolean
    g_mime_gpg_context_get_auto_key_retrieve
                                   (GMimeGpgContext *ctx);

Gets whether or not gpg should auto-retrieve keys from a keyserver when verifying signatures.

#### Parameters

ctx | a GMimeGpgContext |

#### Returns

`TRUE` if gpg should auto-retrieve keys from a keyserver or `FALSE` otherwise.

### g_mime_gpg_context_set_auto_key_retrieve ()

    void
    g_mime_gpg_context_set_auto_key_retrieve
                                   (GMimeGpgContext *ctx,
                                    gboolean auto_key_retrieve);

Sets whether or not gpg should auto-retrieve keys from a keyserver when verifying signatures.

#### Parameters

ctx | a GMimeGpgContext |
auto_key_retrieve | `TRUE` if gpg should auto-retrieve keys from a keys server |

### g_mime_gpg_context_get_use_agent ()

    gboolean
    g_mime_gpg_context_get_use_agent (GMimeGpgContext *ctx);

Gets whether or not gpg should attempt to use the gpg-agent when requesting credentials.

#### Parameters

ctx | a GMimeGpgContext |

#### Returns

`TRUE` if the gpg-agent should be used when requesting credentials or `FALSE` otherwise.

### g_mime_gpg_context_set_use_agent ()

    void
    g_mime_gpg_context_set_use_agent (GMimeGpgContext *ctx,
                                      gboolean use_agent);

Sets whether or not gpg should attempt to use the gpg-agent when requesting credentials.

#### Parameters

ctx | a GMimeGpgContext |
use_agent | use agent flag |

## Types and Values

### struct GMimeGpgContext

    struct GMimeGpgContext {
    	GMimeCryptoContext parent_object;
    	gboolean auto_key_retrieve;
    	gboolean always_trust;
    	gboolean use_agent;
    	char *path;
    	gboolean retrieve_session_key;
    	int version;
    };

A GnuPG crypto context.

#### Members

GMimeCryptoContext `parent_object`; | parent GMimeCryptoContext |
gboolean `auto_key_retrieve`; | `TRUE` if gpg should automatically retrieve unknown keys from the web |
gboolean `always_trust`; | `TRUE` if keys should always be trusted |
gboolean `use_agent`; | `TRUE` if gpg should use the gpg-agent for requesting passphrases |
char *`path`; | path to gpg |
gboolean `retrieve_session_key`; | `TRUE` if session keys should be retrieved when decrypting |
int `version`; | The GnuPG version. |

## See Also

GMimeCryptoContext