Imported Upstream version 2.72.alpha
[platform/upstream/glib-networking.git] / tls / openssl / gtlscertificate-openssl.h
1 /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /*
3  * gtlscertificate-openssl.h
4  *
5  * Copyright (C) 2015 NICE s.r.l.
6  *
7  * This file is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This file is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  * In addition, when the library is used with OpenSSL, a special
21  * exception applies. Refer to the LICENSE_EXCEPTION file for details.
22  *
23  * Authors: Ignacio Casal Quinteiro
24  */
25
26 #pragma once
27
28 #include <gio/gio.h>
29 #include "openssl-include.h"
30
31 G_BEGIN_DECLS
32
33 #define G_TYPE_TLS_CERTIFICATE_OPENSSL (g_tls_certificate_openssl_get_type ())
34 G_DECLARE_FINAL_TYPE (GTlsCertificateOpenssl, g_tls_certificate_openssl,
35                       G, TLS_CERTIFICATE_OPENSSL, GTlsCertificate)
36
37 GTlsCertificate             *g_tls_certificate_openssl_new             (GBytes                 *bytes,
38                                                                         GTlsCertificate        *issuer);
39
40 GTlsCertificate             *g_tls_certificate_openssl_new_from_x509   (X509                   *x,
41                                                                         GTlsCertificate        *issuer);
42
43 void                         g_tls_certificate_openssl_set_data        (GTlsCertificateOpenssl *openssl,
44                                                                         GBytes                 *bytes);
45
46 GBytes *                     g_tls_certificate_openssl_get_bytes       (GTlsCertificateOpenssl *openssl);
47
48 X509                        *g_tls_certificate_openssl_get_cert        (GTlsCertificateOpenssl *openssl);
49 EVP_PKEY                    *g_tls_certificate_openssl_get_key         (GTlsCertificateOpenssl *openssl);
50
51 void                         g_tls_certificate_openssl_set_issuer      (GTlsCertificateOpenssl *openssl,
52                                                                         GTlsCertificateOpenssl *issuer);
53
54 GTlsCertificateFlags         g_tls_certificate_openssl_verify_identity (GTlsCertificateOpenssl *openssl,
55                                                                         GSocketConnectable     *identity);
56
57 GTlsCertificateFlags         g_tls_certificate_openssl_convert_error   (guint                   openssl_error);
58
59 GTlsCertificateOpenssl      *g_tls_certificate_openssl_build_chain     (X509                   *x,
60                                                                         STACK_OF (X509)        *chain);
61
62 G_END_DECLS