summaryrefslogtreecommitdiff
path: root/lib/gnutls_cert.c
diff options
context:
space:
mode:
authorNikos <nmav@crystal.(none)>2008-02-20 21:19:51 +0200
committerNikos <nmav@crystal.(none)>2008-02-20 21:19:51 +0200
commita259726327bf193e9c83f7473d517502ba8a879b (patch)
tree51fa0fd15ff2a4960f1b366f429838c4e5e8ef7f /lib/gnutls_cert.c
parent3867fd247d5960fbed4ecdf7ceab16c618800101 (diff)
downloadgnutls-a259726327bf193e9c83f7473d517502ba8a879b.tar.gz
Added gnutls_certificate_export_x509_cas and other functions to
export elements from the certificate credentials structure.
Diffstat (limited to 'lib/gnutls_cert.c')
-rw-r--r--lib/gnutls_cert.c56
1 files changed, 56 insertions, 0 deletions
diff --git a/lib/gnutls_cert.c b/lib/gnutls_cert.c
index 37ec1b8525..a4f7f45615 100644
--- a/lib/gnutls_cert.c
+++ b/lib/gnutls_cert.c
@@ -115,6 +115,62 @@ gnutls_certificate_free_cas (gnutls_certificate_credentials_t sc)
}
/**
+ * gnutls_certificate_export_x509_cas - Used to export all the CAs from a gnutls_certificate_credentials_t structure
+ * @sc: is an #gnutls_certificate_credentials_t structure.
+ * @x509_ca_list: the exported CA list. Should be treated as constant
+ * @ncas: the number of exported CAs
+ *
+ * This function will export all the CAs associated
+ * with the given credentials.
+ *
+ **/
+void
+gnutls_certificate_export_x509_cas (gnutls_certificate_credentials_t sc,
+ gnutls_x509_crt_t **x509_ca_list, unsigned int* ncas)
+{
+ *x509_ca_list = sc->x509_ca_list;
+ *ncas = sc->x509_ncas;
+}
+
+/**
+ * gnutls_certificate_export_x509_crls - Used to export all the CRLs from a gnutls_certificate_credentials_t structure
+ * @sc: is an #gnutls_certificate_credentials_t structure.
+ * @ring: the exported keyring. Should be treated as constant
+ *
+ * This function will export the OpenPGP keyring associated
+ * with the given credentials.
+ *
+ **/
+void
+gnutls_certificate_export_x509_crls (gnutls_certificate_credentials_t sc,
+ gnutls_x509_crl_t **x509_crl_list, unsigned int* ncrls)
+{
+ *x509_crl_list = sc->x509_crl_list;
+ *ncrls = sc->x509_ncrls;
+}
+
+#ifdef ENABLE_OPENPGP
+
+/**
+ * gnutls_certificate_export_openpgp_keyring - Used to export the keyring from a gnutls_certificate_credentials_t structure
+ * @sc: is an #gnutls_certificate_credentials_t structure.
+ * @x509_crl_list: the exported CRL list. Should be treated as constant
+ * @ncrls: the number of exported CRLs
+ *
+ * This function will export all the CRLs associated
+ * with the given credentials.
+ *
+ **/
+void
+gnutls_certificate_export_openpgp_keyring (gnutls_certificate_credentials_t sc,
+ gnutls_openpgp_keyring_t *keyring)
+{
+ *keyring = sc->keyring;
+}
+
+#endif
+
+/**
* gnutls_certificate_free_ca_names - Used to free all the CA names from a gnutls_certificate_credentials_t structure
* @sc: is an #gnutls_certificate_credentials_t structure.
*