/** * g_tls_file_database_new: * @anchors: (type filename): filename of anchor certificate authorities. * @error: #GError for error reporting, or %NULL to ignore. * * Creates a new #GTlsFileDatabase which uses anchor certificate authorities * in @anchors to verify certificate chains. * * The certificates in @anchors must be PEM encoded. * * Returns: (transfer full) (type GTlsFileDatabase): the new * #GTlsFileDatabase, or %NULL on error * * Since: 2.30 */ GTlsDatabase* g_tls_file_database_new (const gchar *anchors, GError **error) { GObject *database; GTlsBackend *backend; backend = g_tls_backend_get_default (); database = g_initable_new (g_tls_backend_get_file_database_type (backend), NULL, error, "anchors", anchors, NULL); return G_TLS_DATABASE (database); }
static void async_lookup_certificates_issued_by_thread (GSimpleAsyncResult *res, GObject *object, GCancellable *cancellable) { AsyncLookupCertificatesIssuedBy *args = g_simple_async_result_get_op_res_gpointer (res); GError *error = NULL; args->results = g_tls_database_lookup_certificates_issued_by (G_TLS_DATABASE (object), args->issuer, args->interaction, args->flags, cancellable, &error); if (error) g_simple_async_result_take_error (res, error); }
static void async_verify_chain_thread (GSimpleAsyncResult *res, GObject *object, GCancellable *cancellable) { AsyncVerifyChain *args = g_simple_async_result_get_op_res_gpointer (res); GError *error = NULL; args->verify_result = g_tls_database_verify_chain (G_TLS_DATABASE (object), args->chain, args->purpose, args->identity, args->interaction, args->flags, cancellable, &error); if (error) g_simple_async_result_take_error (res, error); }