blob: be14a0d1bc3eff0e0bd2136307cd813769376280 [file] [log] [blame]
William Lallemand6a66a5e2020-05-15 12:01:17 +02001/*
2 * include/proto/ssl_utils.h
3 *
4 * Utility functions for SSL:
5 * Mostly generic functions that retrieve information from certificates
6 *
7 * Copyright (C) 2012 EXCELIANCE, Emeric Brun <ebrun@exceliance.fr>
8 * Copyright (C) 2020 HAProxy Technologies, William Lallemand <wlallemand@haproxy.com>
9 *
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public
12 * License as published by the Free Software Foundation, version 2.1
13 * exclusively.
14 *
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Lesser General Public License for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with this library; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 */
24
25#ifndef _TYPES_SSL_UTILS_H
26#define _TYPES_SSL_UTILS_H
27#ifdef USE_OPENSSL
28
29int cert_get_pkey_algo(X509 *crt, struct buffer *out);
30int ssl_sock_get_serial(X509 *crt, struct buffer *out);
31int ssl_sock_crt2der(X509 *crt, struct buffer *out);
32int ssl_sock_get_time(ASN1_TIME *tm, struct buffer *out);
33int ssl_sock_get_dn_entry(X509_NAME *a, const struct buffer *entry, int pos,
34 struct buffer *out);
35int ssl_sock_get_dn_formatted(X509_NAME *a, const struct buffer *format, struct buffer *out);
36int ssl_sock_get_dn_oneline(X509_NAME *a, struct buffer *out);
37
38#endif /* _TYPES_SSL_UTILS_H */
39#endif /* USE_OPENSSL */
40