tlsutils.h
Go to the documentation of this file.
/* SPDX-FileCopyrightText: 2009-2023 Greenbone AG
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef _GVM_UTIL_TLSUTILS_H
#define _GVM_UTIL_TLSUTILS_H
#include <glib.h>
#include <gnutls/gnutls.h>
#include <gnutls/pkcs12.h>
gnutls_x509_crt_fmt_t
gvm_x509_format_from_data (const char *, size_t);
int
gvm_base64_to_gnutls_datum (const char *, gnutls_datum_t *);
void
gvm_x509_cert_list_free (gnutls_x509_crt_t *certs, unsigned int certs_count);
gchar *
gvm_x509_privkey_to_pem (gnutls_x509_privkey_t privkey);
gchar *
gvm_x509_cert_list_to_pem (gnutls_x509_crt_t *certs, unsigned int certs_count);
gchar *
gvm_x509_crl_to_pem (gnutls_x509_crl_t crl);
int
gvm_pkcs12_to_pem (gnutls_pkcs12_t pkcs12, const char *passphrase,
gchar **privkey_out, gchar **cert_chain_out,
gchar **extra_certs_out, gchar **crl_out);
#endif /* not _GVM_UTIL_TLSUTILS_H */
gvm_x509_cert_list_to_pem
gchar * gvm_x509_cert_list_to_pem(gnutls_x509_crt_t *certs, unsigned int certs_count)
Export a GnuTLS x509 cerificate list as a PEM formatted string.
Definition tlsutils.c:111
gvm_base64_to_gnutls_datum
int gvm_base64_to_gnutls_datum(const char *, gnutls_datum_t *)
Decode a Base64 string to the contents of a gnutls_datum_t.
Definition tlsutils.c:48
gvm_x509_format_from_data
gnutls_x509_crt_fmt_t gvm_x509_format_from_data(const char *, size_t)
Try to determine the format (DER or PEM) of a x509 certificate.
Definition tlsutils.c:30
gvm_x509_crl_to_pem
gchar * gvm_x509_crl_to_pem(gnutls_x509_crl_t crl)
Export a GnuTLS x509 CRL as a PEM formatted string.
Definition tlsutils.c:143
gvm_x509_cert_list_free
void gvm_x509_cert_list_free(gnutls_x509_crt_t *certs, unsigned int certs_count)
Frees a list of X509 certificates.
Definition tlsutils.c:66
gvm_pkcs12_to_pem
int gvm_pkcs12_to_pem(gnutls_pkcs12_t pkcs12, const char *passphrase, gchar **privkey_out, gchar **cert_chain_out, gchar **extra_certs_out, gchar **crl_out)
Convert GnuTLS PKCS12 data to a PEM formatted string.
Definition tlsutils.c:175
gvm_x509_privkey_to_pem
gchar * gvm_x509_privkey_to_pem(gnutls_x509_privkey_t privkey)
Export a GnuTLS x509 private key as a PEM formatted string.
Definition tlsutils.c:83