Greenbone Vulnerability Management Libraries: util/tlsutils.h Source File

Greenbone Vulnerability Management Libraries 23.1.2

tlsutils.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2009-2023 Greenbone AG
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later
4 */
5
10
11#ifndef _GVM_UTIL_TLSUTILS_H
12#define _GVM_UTIL_TLSUTILS_H
13
14#include <glib.h>
15#include <gnutls/gnutls.h>
16#include <gnutls/pkcs12.h>
17
18gnutls_x509_crt_fmt_t
19 gvm_x509_format_from_data (const char *, size_t);
20
21int
22 gvm_base64_to_gnutls_datum (const char *, gnutls_datum_t *);
23
24void
25 gvm_x509_cert_list_free (gnutls_x509_crt_t *certs, unsigned int certs_count);
26
27gchar *
28 gvm_x509_privkey_to_pem (gnutls_x509_privkey_t privkey);
29
30gchar *
31 gvm_x509_cert_list_to_pem (gnutls_x509_crt_t *certs, unsigned int certs_count);
32
33gchar *
34 gvm_x509_crl_to_pem (gnutls_x509_crl_t crl);
35
36int
37 gvm_pkcs12_to_pem (gnutls_pkcs12_t pkcs12, const char *passphrase,
38 gchar **privkey_out, gchar **cert_chain_out,
39 gchar **extra_certs_out, gchar **crl_out);
40
41#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