ESourceOpenPGP: Evolution-Data-Server Reference Manual

## ESourceOpenPGP ESourceOpenPGP — ESource extension for OpenPGP settings |

## Functions

gboolean | e_source_openpgp_get_always_trust ()
void | e_source_openpgp_set_always_trust ()
gboolean | e_source_openpgp_get_encrypt_to_self ()
void | e_source_openpgp_set_encrypt_to_self ()
const gchar * | e_source_openpgp_get_key_id ()
gchar * | e_source_openpgp_dup_key_id ()
void | e_source_openpgp_set_key_id ()
const gchar * | e_source_openpgp_get_signing_algorithm ()
gchar * | e_source_openpgp_dup_signing_algorithm ()
void | e_source_openpgp_set_signing_algorithm ()
gboolean | e_source_openpgp_get_sign_by_default ()
void | e_source_openpgp_set_sign_by_default ()
gboolean | e_source_openpgp_get_encrypt_by_default ()
void | e_source_openpgp_set_encrypt_by_default ()
gboolean | e_source_openpgp_get_prefer_inline ()
void | e_source_openpgp_set_prefer_inline ()
gboolean | e_source_openpgp_get_locate_keys ()
void | e_source_openpgp_set_locate_keys ()
gboolean | e_source_openpgp_get_send_public_key ()
void | e_source_openpgp_set_send_public_key ()
gboolean | e_source_openpgp_get_send_prefer_encrypt ()
void | e_source_openpgp_set_send_prefer_encrypt ()
gboolean | e_source_openpgp_get_ask_send_public_key ()
void | e_source_openpgp_set_ask_send_public_key ()

## Types and Values

#define | E_SOURCE_EXTENSION_OPENPGP
struct | ESourceOpenPGP

## Object Hierarchy

        GObject
        ╰── ESourceExtension
            ╰── ESourceOpenPGP

## Includes

    #include <libedataserver/libedataserver.h>

## Description

The ESourceOpenPGP extension tracks OpenPGP (RFC 4880) settings to be applied to outgoing mail messages.

Access the extension as follows:

    1
    2
    3
    4
    5
    #include <libedataserver/libedataserver.h>

    ESourceOpenPGP *extension;

    extension = e_source_get_extension (source, E_SOURCE_EXTENSION_OPENPGP);

## Functions

### e_source_openpgp_get_always_trust ()

    gboolean
    e_source_openpgp_get_always_trust (ESourceOpenPGP *extension);

Returns whether to skip key validation and assume that used keys are always fully trusted.

#### Parameters

extension | an ESourceOpenPGP |

#### Returns

whether used keys are always fully trusted

Since: 3.6

### e_source_openpgp_set_always_trust ()

    void
    e_source_openpgp_set_always_trust (ESourceOpenPGP *extension,
                                       gboolean always_trust);

Sets whether to skip key validation and assume that used keys are always fully trusted.

#### Parameters

extension | an ESourceOpenPGP |
always_trust | whether used keys are always fully trusted |

Since: 3.6

### e_source_openpgp_get_encrypt_to_self ()

    gboolean
    e_source_openpgp_get_encrypt_to_self (ESourceOpenPGP *extension);

Returns whether to "encrypt-to-self" when sending encrypted messages.

#### Parameters

extension | an ESourceOpenPGP |

#### Returns

whether to "encrypt-to-self"

Since: 3.6

### e_source_openpgp_set_encrypt_to_self ()

    void
    e_source_openpgp_set_encrypt_to_self (ESourceOpenPGP *extension,
                                          gboolean encrypt_to_self);

Sets whether to "encrypt-to-self" when sending encrypted messages.

#### Parameters

extension | an ESourceOpenPGP |
encrypt_to_self | whether to "encrypt-to-self" |

Since: 3.6

### e_source_openpgp_get_key_id ()

    const gchar *
    e_source_openpgp_get_key_id (ESourceOpenPGP *extension);

Returns the OpenPGP key ID used to sign and encrypt messages.

#### Parameters

extension | an ESourceOpenPGP |

#### Returns

the key ID used to sign and encrypt messages

Since: 3.6

### e_source_openpgp_dup_key_id ()

    gchar *
    e_source_openpgp_dup_key_id (ESourceOpenPGP *extension);

Thread-safe variation of `e_source_openpgp_get_key_id()`. Use this function when accessing `extension` from multiple threads.

The returned string should be freed with `g_free()` when no longer needed.

#### Parameters

extension | an ESourceOpenPGP |

#### Returns

a newly-allocated copy of “key-id”

Since: 3.6

### e_source_openpgp_set_key_id ()

    void
    e_source_openpgp_set_key_id (ESourceOpenPGP *extension,
                                 const gchar *key_id);

Sets the OpenPGP key ID used to sign and encrypt messages.

The internal copy of `key_id` is automatically stripped of leading and trailing whitespace. If the resulting string is empty, `NULL` is set instead.

#### Parameters

extension | an ESourceOpenPGP |
key_id | the key ID used to sign and encrypt messages |

Since: 3.6

### e_source_openpgp_get_signing_algorithm ()

    const gchar *
    e_source_openpgp_get_signing_algorithm
                                   (ESourceOpenPGP *extension);

Returns the name of the hash algorithm used to digitally sign outgoing messages.

#### Parameters

extension | an ESourceOpenPGP |

#### Returns

the signing algorithm for outgoing messages

Since: 3.6

### e_source_openpgp_dup_signing_algorithm ()

    gchar *
    e_source_openpgp_dup_signing_algorithm
                                   (ESourceOpenPGP *extension);

Thread-safe variation of `e_source_openpgp_get_signing_algorithm()`. Use this function when accessing `extension` from multiple threads.

The returned string should be freed with `g_free()` when no longer needed.

#### Parameters

extension | an ESourceOpenPGP |

#### Returns

a newly-allocated copy of “signing-algorithm”

Since: 3.6

### e_source_openpgp_set_signing_algorithm ()

    void
    e_source_openpgp_set_signing_algorithm
                                   (ESourceOpenPGP *extension,
                                    const gchar *signing_algorithm);

Sets the name of the hash algorithm used to digitally sign outgoing messages.

The internal copy of `signing_algorithm` is automatically stripped of leading and trailing whitespace. If the resulting string is empty, `NULL` is set instead.

#### Parameters

extension | an ESourceOpenPGP |
signing_algorithm | the signing algorithm for outgoing messages |

Since: 3.6

### e_source_openpgp_get_sign_by_default ()

    gboolean
    e_source_openpgp_get_sign_by_default (ESourceOpenPGP *extension);

Returns whether to digitally sign outgoing messages by default using OpenPGP-compliant software such as GNU Privacy Guard (GnuPG).

#### Parameters

extension | an ESourceOpenPGP |

#### Returns

whether to sign outgoing messages by default

Since: 3.6

### e_source_openpgp_set_sign_by_default ()

    void
    e_source_openpgp_set_sign_by_default (ESourceOpenPGP *extension,
                                          gboolean sign_by_default);

Sets whether to digitally sign outgoing messages by default using OpenPGP-compliant software such as GNU Privacy Guard (GnuPG).

#### Parameters

extension | an ESourceOpenPGP |
sign_by_default | whether to sign outgoing messages by default |

Since: 3.6

### e_source_openpgp_get_encrypt_by_default ()

    gboolean
    e_source_openpgp_get_encrypt_by_default
                                   (ESourceOpenPGP *extension);

Returns whether to digitally encrypt outgoing messages by default using OpenPGP-compliant software such as GNU Privacy Guard (GnuPG).

#### Parameters

extension | an ESourceOpenPGP |

#### Returns

whether to encrypt outgoing messages by default

Since: 3.18

### e_source_openpgp_set_encrypt_by_default ()

    void
    e_source_openpgp_set_encrypt_by_default
                                   (ESourceOpenPGP *extension,
                                    gboolean encrypt_by_default);

Sets whether to digitally encrypt outgoing messages by default using OpenPGP-compliant software such as GNU Privacy Guard (GnuPG).

#### Parameters

extension | an ESourceOpenPGP |
encrypt_by_default | whether to encrypt outgoing messages by default |

Since: 3.18

### e_source_openpgp_get_prefer_inline ()

    gboolean
    e_source_openpgp_get_prefer_inline (ESourceOpenPGP *extension);

Returns whether to prefer inline sign/encrypt of the text/plain messages.

#### Parameters

extension | an ESourceOpenPGP |

#### Returns

whether to prefer inline sign/encrypt of the text/plain messages

Since: 3.20

### e_source_openpgp_set_prefer_inline ()

    void
    e_source_openpgp_set_prefer_inline (ESourceOpenPGP *extension,
                                        gboolean prefer_inline);

Sets whether to prefer inline sign/encrypt of the text/plain messages.

#### Parameters

extension | an ESourceOpenPGP |
prefer_inline | whether to prefer inline sign/encrypt of the text/plain messages |

Since: 3.20

### e_source_openpgp_get_locate_keys ()

    gboolean
    e_source_openpgp_get_locate_keys (ESourceOpenPGP *extension);

Returns, whether gpg can locate keys using Web Key Directory (WKD) lookup when encrypting messages. The default is `TRUE`.

#### Parameters

extension | an ESourceOpenPGP |

#### Returns

whether gpg can locate keys using Web Key Directory (WKD) lookup when encrypting messages.

Since: 3.46

### e_source_openpgp_set_locate_keys ()

    void
    e_source_openpgp_set_locate_keys (ESourceOpenPGP *extension,
                                      gboolean locate_keys);

Sets the `locate_keys` on the `extension` , which is used to instruct gpg to locate keys using Web Key Directory (WKD) lookup when encrypting messages.

#### Parameters

extension | an ESourceOpenPGP |
locate_keys | value to set |

Since: 3.46

### e_source_openpgp_get_send_public_key ()

    gboolean
    e_source_openpgp_get_send_public_key (ESourceOpenPGP *extension);

Returns, whether should send PGP public key in messages. The default is `TRUE`.

#### Parameters

extension | an ESourceOpenPGP |

#### Returns

whether should send PGP public key in messages

Since: 3.50

### e_source_openpgp_set_send_public_key ()

    void
    e_source_openpgp_set_send_public_key (ESourceOpenPGP *extension,
                                          gboolean send_public_key);

Sets the `send_public_key` on the `extension` , which tells the client to include user's public key in the messages in an Autocrypt header.

#### Parameters

extension | an ESourceOpenPGP |
send_public_key | value to set |

Since: 3.50

### e_source_openpgp_get_send_prefer_encrypt ()

    gboolean
    e_source_openpgp_get_send_prefer_encrypt
                                   (ESourceOpenPGP *extension);

Returns, whether should claim the encryption is preferred when sending public key in messages. The default is `TRUE`.

#### Parameters

extension | an ESourceOpenPGP |

#### Returns

whether should claim the encryption is preferred when sending public key in messages

Since: 3.50

### e_source_openpgp_set_send_prefer_encrypt ()

    void
    e_source_openpgp_set_send_prefer_encrypt
                                   (ESourceOpenPGP *extension,
                                    gboolean send_prefer_encrypt);

Sets the `send_prefer_encrypt` on the `extension` , which tells the client to claim the user prefer encryption when also sending its public key in the messages (`e_source_openpgp_set_send_public_key()`).

#### Parameters

extension | an ESourceOpenPGP |
send_prefer_encrypt | value to set |

Since: 3.50

### e_source_openpgp_get_ask_send_public_key ()

    gboolean
    e_source_openpgp_get_ask_send_public_key
                                   (ESourceOpenPGP *extension);

Returns, whether should ask before sending PGP public key in messages. The default is `TRUE`.

#### Parameters

extension | an ESourceOpenPGP |

#### Returns

whether should ask before sending PGP public key in messages

Since: 3.52

### e_source_openpgp_set_ask_send_public_key ()

    void
    e_source_openpgp_set_ask_send_public_key
                                   (ESourceOpenPGP *extension,
                                    gboolean ask_send_public_key);

Sets the `ask_send_public_key` on the `extension` , which tells the client to ask before user sends public key in the messages in an Autocrypt header.

#### Parameters

extension | an ESourceOpenPGP |
ask_send_public_key | value to set |

Since: 3.52

## Types and Values

### E_SOURCE_EXTENSION_OPENPGP

    #define E_SOURCE_EXTENSION_OPENPGP "Pretty Good Privacy (OpenPGP)"

Pass this extension name to `e_source_get_extension()` to access ESourceOpenPGP. This is also used as a group name in key files.

Since: 3.6

### struct ESourceOpenPGP

    struct ESourceOpenPGP;

Since: 3.6