File: tlsutils.h

package info (click to toggle)
gvm-libs 22.35.4-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,980 kB
  • sloc: ansic: 39,095; makefile: 26
file content (41 lines) | stat: -rw-r--r-- 977 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/* SPDX-FileCopyrightText: 2009-2023 Greenbone AG
 *
 * SPDX-License-Identifier: GPL-2.0-or-later
 */

/**
 * @file tlsutils.h
 * @brief TLS certificate utilities headers.
 */

#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 */