## CamelCertDB

CamelCertDB

## Functions

CamelCert * | camel_cert_new ()
CamelCert * | camel_cert_ref ()
void | camel_cert_unref ()
gboolean | camel_cert_load_cert_file ()
gboolean | camel_cert_save_cert_file ()
CamelCertDB * | camel_certdb_new ()
void | camel_certdb_set_default ()
CamelCertDB * | camel_certdb_get_default ()
void | camel_certdb_set_filename ()
gint | camel_certdb_load ()
gint | camel_certdb_save ()
void | camel_certdb_touch ()
CamelCert * | camel_certdb_get_host ()
void | camel_certdb_put ()
void | camel_certdb_remove_host ()
void | camel_certdb_clear ()
GSList * | camel_certdb_list_certs ()

## Types and Values

enum | CamelCertTrust

## Object Hierarchy

        GBoxed
        ╰── CamelCert
        GObject
        ╰── CamelCertDB

## Description

## Functions

### camel_cert_new ()

    CamelCert *
    camel_cert_new (void);

### camel_cert_ref ()

    CamelCert *
    camel_cert_ref (CamelCert *cert);

### camel_cert_unref ()

    void
    camel_cert_unref (CamelCert *cert);

### camel_cert_load_cert_file ()

    gboolean
    camel_cert_load_cert_file (CamelCert *cert,
                               GError **error);

### camel_cert_save_cert_file ()

    gboolean
    camel_cert_save_cert_file (CamelCert *cert,
                               const GByteArray *der_data,
                               GError **error);

### camel_certdb_new ()

    CamelCertDB *
    camel_certdb_new (void);

### camel_certdb_set_default ()

    void
    camel_certdb_set_default (CamelCertDB *certdb);

### camel_certdb_get_default ()

    CamelCertDB *
    camel_certdb_get_default (void);

FIXME Document me!

#### Returns

.

[transfer full]

### camel_certdb_set_filename ()

    void
    camel_certdb_set_filename (CamelCertDB *certdb,
                               const gchar *filename);

### camel_certdb_load ()

    gint
    camel_certdb_load (CamelCertDB *certdb);

### camel_certdb_save ()

    gint
    camel_certdb_save (CamelCertDB *certdb);

### camel_certdb_touch ()

    void
    camel_certdb_touch (CamelCertDB *certdb);

### camel_certdb_get_host ()

    CamelCert *
    camel_certdb_get_host (CamelCertDB *certdb,
                           const gchar *hostname,
                           const gchar *fingerprint);

#### Parameters

certdb | a CamelCertDB |
hostname | a host name of a certificate |
fingerprint | a fingerprint of a certificate |

#### Returns

a CamelCert corresponding to the pair of `hostname` and `fingerprint` , or `NULL`, if no such certificate is stored in the `certdb` .

[nullable][transfer full]

Since: 3.6

### camel_certdb_put ()

    void
    camel_certdb_put (CamelCertDB *certdb,
                      CamelCert *cert);

Puts a certificate to the database. In case there exists a certificate with the same hostname and fingerprint, then it is replaced. This adds its own reference on the `cert` .

#### Parameters

certdb | a CamelCertDB |
cert | a CamelCert |

Since: 3.6

### camel_certdb_remove_host ()

    void
    camel_certdb_remove_host (CamelCertDB *certdb,
                              const gchar *hostname,
                              const gchar *fingerprint);

Removes a certificate identified by the `hostname` and `fingerprint` .

#### Parameters

certdb | a CamelCertDB |
hostname | a host name of a certificate |
fingerprint | a fingerprint of a certificate |

Since: 3.6

### camel_certdb_clear ()

    void
    camel_certdb_clear (CamelCertDB *certdb);

### camel_certdb_list_certs ()

    GSList *
    camel_certdb_list_certs (CamelCertDB *certdb);

Gathers a list of known certificates. Each certificate in the returned GSList is referenced, thus unref it with `camel_cert_unref()` when done with it, the same as free the list itself.

#### Parameters

certdb | a CamelCertDB |

#### Returns

Newly allocated list of referenced CamelCert-s, which are stored in the `certdb` .

[transfer full][element-type CamelCert]

Since: 3.16

## Types and Values

### enum CamelCertTrust

#### Members

CAMEL_CERT_TRUST_UNKNOWN |  |
CAMEL_CERT_TRUST_NEVER |  |
CAMEL_CERT_TRUST_MARGINAL |  |
CAMEL_CERT_TRUST_FULLY |  |
CAMEL_CERT_TRUST_ULTIMATE |  |
CAMEL_CERT_TRUST_TEMPORARY |  |