return ret;
}
+/**
+ * gnutls_certificate_set_x509_trust_dir:
+ * @cred: is a #gnutls_certificate_credentials_t structure.
+ * @ca_dir: is a directory containing the list of trusted CAs (DER or PEM list)
+ * @type: is PEM or DER
+ *
+ * This function adds the trusted CAs present in the directory in order to
+ * verify client or server certificates. This function is identical
+ * to gnutls_certificate_set_x509_trust_file() but loads all certificates
+ * in a directory.
+ *
+ * Returns: number of certificates processed, or a negative error code on
+ * error.
+ **/
+int
+gnutls_certificate_set_x509_trust_dir(gnutls_certificate_credentials_t cred,
+ const char *ca_dir,
+ gnutls_x509_crt_fmt_t type)
+{
+int ret;
+
+ ret = gnutls_x509_trust_list_add_trust_dir(cred->tlist, ca_dir, NULL,
+ type, GNUTLS_TL_USE_IN_TLS, 0);
+ if (ret == GNUTLS_E_NO_CERTIFICATE_FOUND)
+ return 0;
+
+ return ret;
+}
+
/**
* gnutls_certificate_set_x509_system_trust:
* @cred: is a #gnutls_certificate_credentials_t structure.
gnutls_certificate_set_x509_trust_file(gnutls_certificate_credentials_t
cred, const char *cafile,
gnutls_x509_crt_fmt_t type);
+int
+gnutls_certificate_set_x509_trust_dir(gnutls_certificate_credentials_t cred,
+ const char *ca_dir,
+ gnutls_x509_crt_fmt_t type);
+
int gnutls_certificate_set_x509_trust_mem(gnutls_certificate_credentials_t
res, const gnutls_datum_t * ca,
gnutls_x509_crt_fmt_t type);
gnutls_record_recv_packet;
gnutls_packet_get;
gnutls_x509_trust_list_add_trust_dir;
+ gnutls_certificate_set_x509_trust_dir;
} GNUTLS_3_0_0;
GNUTLS_FIPS140 {