Github User Fetcher 1.0.0
C Application with Server and GUI
Loading...
Searching...
No Matches
gtlsconnection.h
Go to the documentation of this file.
1/* GIO - GLib Input, Output and Streaming Library
2 *
3 * Copyright (C) 2010 Red Hat, Inc.
4 *
5 * SPDX-License-Identifier: LGPL-2.1-or-later
6 *
7 * This library 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 library 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
18 * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
19 */
20
21#ifndef __G_TLS_CONNECTION_H__
22#define __G_TLS_CONNECTION_H__
23
24#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
25#error "Only <gio/gio.h> can be included directly."
26#endif
27
28#include <gio/giostream.h>
29
31
32#define G_TYPE_TLS_CONNECTION (g_tls_connection_get_type ())
33#define G_TLS_CONNECTION(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), G_TYPE_TLS_CONNECTION, GTlsConnection))
34#define G_TLS_CONNECTION_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), G_TYPE_TLS_CONNECTION, GTlsConnectionClass))
35#define G_IS_TLS_CONNECTION(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), G_TYPE_TLS_CONNECTION))
36#define G_IS_TLS_CONNECTION_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), G_TYPE_TLS_CONNECTION))
37#define G_TLS_CONNECTION_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), G_TYPE_TLS_CONNECTION, GTlsConnectionClass))
38
40typedef struct _GTlsConnectionPrivate GTlsConnectionPrivate;
41
47
48/**
49 * GTlsConnectionClass:
50 * @parent_class: The parent class.
51 * @accept_certificate: Check whether to accept a certificate.
52 * @handshake: Perform a handshake operation.
53 * @handshake_async: Start an asynchronous handshake operation.
54 * @handshake_finish: Finish an asynchronous handshake operation.
55 * @get_binding_data: Retrieve TLS channel binding data (Since: 2.66)
56 * @get_negotiated_protocol: Get ALPN-negotiated protocol (Since: 2.70)
57 *
58 * The class structure for the #GTlsConnection type.
59 *
60 * Since: 2.28
61 */
63{
65
66 /* signals */
68 GTlsCertificate *peer_cert,
70
71 /* methods */
73 GCancellable *cancellable,
74 GError **error);
75
77 int io_priority,
78 GCancellable *cancellable,
79 GAsyncReadyCallback callback,
80 gpointer user_data);
82 GAsyncResult *result,
83 GError **error);
84
88 GByteArray *data,
89 GError **error);
91
92 const gchar *(*get_negotiated_protocol) (GTlsConnection *conn);
93
94 /*< private >*/
95 /* Padding for future expansion */
97};
98
101
104 gboolean use_system_certdb);
107
110 GTlsDatabase *database);
113
116 GTlsCertificate *certificate);
119
122 GTlsInteraction *interaction);
125
130
133 gboolean require_close_notify);
136
144
147 const gchar * const *protocols);
148
151
156 GByteArray *data,
157 GError **error);
159
162 GCancellable *cancellable,
163 GError **error);
164
167 int io_priority,
168 GCancellable *cancellable,
169 GAsyncReadyCallback callback,
170 gpointer user_data);
173 GAsyncResult *result,
174 GError **error);
175
178
181
182/**
183 * G_TLS_ERROR:
184 *
185 * Error domain for TLS. Errors in this domain will be from the
186 * #GTlsError enumeration. See #GError for more information on error
187 * domains.
188 */
189#define G_TLS_ERROR (g_tls_error_quark ())
192
193/**
194 * G_TLS_CHANNEL_BINDING_ERROR:
195 *
196 * Error domain for TLS channel binding. Errors in this domain will be from the
197 * #GTlsChannelBindingError enumeration. See #GError for more information on error
198 * domains.
199 *
200 * Since: 2.66
201 */
202#define G_TLS_CHANNEL_BINDING_ERROR (g_tls_channel_binding_error_quark ())
205
206/*< protected >*/
209 GTlsCertificate *peer_cert,
210 GTlsCertificateFlags errors);
211
213
214#endif /* __G_TLS_CONNECTION_H__ */
#define GIO_DEPRECATED_IN_2_60
#define GIO_AVAILABLE_IN_ALL
#define GIO_DEPRECATED
#define GIO_AVAILABLE_IN_2_60
#define GIO_AVAILABLE_IN_2_70
#define GIO_AVAILABLE_IN_2_66
GTlsCertificateFlags
Definition gioenums.h:1633
GTlsChannelBindingType
Definition gioenums.h:1682
GTlsProtocolVersion
Definition gioenums.h:1895
GTlsRehandshakeMode
Definition gioenums.h:1736
struct _GAsyncResult GAsyncResult
Definition giotypes.h:36
void(* GAsyncReadyCallback)(GObject *source_object, GAsyncResult *res, gpointer data)
Definition giotypes.h:190
#define G_END_DECLS
Definition gmacros.h:910
#define G_BEGIN_DECLS
Definition gmacros.h:909
#define G_GNUC_BEGIN_IGNORE_DEPRECATIONS
Definition gmacros.h:771
#define G_GNUC_CONST
Definition gmacros.h:637
#define G_GNUC_END_IGNORE_DEPRECATIONS
Definition gmacros.h:772
G_BEGIN_DECLS typedef guint32 GQuark
Definition gquark.h:38
GIO_AVAILABLE_IN_2_60 const gchar * g_tls_connection_get_negotiated_protocol(GTlsConnection *conn)
GIO_AVAILABLE_IN_ALL GTlsCertificateFlags g_tls_connection_get_peer_certificate_errors(GTlsConnection *conn)
GIO_DEPRECATED void g_tls_connection_set_use_system_certdb(GTlsConnection *conn, gboolean use_system_certdb)
GIO_AVAILABLE_IN_2_66 GQuark g_tls_channel_binding_error_quark(void)
G_GNUC_BEGIN_IGNORE_DEPRECATIONS GIO_AVAILABLE_IN_2_66 gboolean g_tls_connection_get_channel_binding_data(GTlsConnection *conn, GTlsChannelBindingType type, GByteArray *data, GError **error)
GIO_DEPRECATED_IN_2_60 GTlsRehandshakeMode g_tls_connection_get_rehandshake_mode(GTlsConnection *conn)
G_GNUC_END_IGNORE_DEPRECATIONS GIO_AVAILABLE_IN_ALL gboolean g_tls_connection_handshake(GTlsConnection *conn, GCancellable *cancellable, GError **error)
GIO_AVAILABLE_IN_ALL gboolean g_tls_connection_emit_accept_certificate(GTlsConnection *conn, GTlsCertificate *peer_cert, GTlsCertificateFlags errors)
GIO_AVAILABLE_IN_ALL void g_tls_connection_set_database(GTlsConnection *conn, GTlsDatabase *database)
GIO_AVAILABLE_IN_ALL gboolean g_tls_connection_get_require_close_notify(GTlsConnection *conn)
GIO_AVAILABLE_IN_ALL void g_tls_connection_handshake_async(GTlsConnection *conn, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
GIO_AVAILABLE_IN_ALL GTlsCertificate * g_tls_connection_get_certificate(GTlsConnection *conn)
GIO_DEPRECATED gboolean g_tls_connection_get_use_system_certdb(GTlsConnection *conn)
GIO_AVAILABLE_IN_ALL GTlsDatabase * g_tls_connection_get_database(GTlsConnection *conn)
G_GNUC_END_IGNORE_DEPRECATIONS GIO_AVAILABLE_IN_2_60 void g_tls_connection_set_advertised_protocols(GTlsConnection *conn, const gchar *const *protocols)
G_GNUC_BEGIN_IGNORE_DEPRECATIONS GIO_DEPRECATED_IN_2_60 void g_tls_connection_set_rehandshake_mode(GTlsConnection *conn, GTlsRehandshakeMode mode)
GIO_AVAILABLE_IN_ALL void g_tls_connection_set_certificate(GTlsConnection *conn, GTlsCertificate *certificate)
GIO_AVAILABLE_IN_2_70 GTlsProtocolVersion g_tls_connection_get_protocol_version(GTlsConnection *conn)
GIO_AVAILABLE_IN_ALL GTlsInteraction * g_tls_connection_get_interaction(GTlsConnection *conn)
struct _GTlsConnectionPrivate GTlsConnectionPrivate
GIO_AVAILABLE_IN_ALL GType g_tls_connection_get_type(void) G_GNUC_CONST
GIO_AVAILABLE_IN_ALL GTlsCertificate * g_tls_connection_get_peer_certificate(GTlsConnection *conn)
GIO_AVAILABLE_IN_ALL void g_tls_connection_set_interaction(GTlsConnection *conn, GTlsInteraction *interaction)
GIO_AVAILABLE_IN_ALL GQuark g_tls_error_quark(void)
GIO_AVAILABLE_IN_ALL void g_tls_connection_set_require_close_notify(GTlsConnection *conn, gboolean require_close_notify)
GIO_AVAILABLE_IN_2_70 gchar * g_tls_connection_get_ciphersuite_name(GTlsConnection *conn)
GIO_AVAILABLE_IN_ALL gboolean g_tls_connection_handshake_finish(GTlsConnection *conn, GAsyncResult *result, GError **error)
gsize GType
Definition gtype.h:427
gint gboolean
Definition gtypes.h:56
G_BEGIN_DECLS typedef char gchar
Definition gtypes.h:52
void * gpointer
Definition gtypes.h:109
static void error(LoadState *S, const char *why)
gboolean(* handshake)(GTlsConnection *conn, GCancellable *cancellable, GError **error)
gboolean(* handshake_finish)(GTlsConnection *conn, GAsyncResult *result, GError **error)
gboolean(* accept_certificate)(GTlsConnection *connection, GTlsCertificate *peer_cert, GTlsCertificateFlags errors)
void(* handshake_async)(GTlsConnection *conn, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
GIOStreamClass parent_class
G_GNUC_BEGIN_IGNORE_DEPRECATIONS gboolean(* get_binding_data)(GTlsConnection *conn, GTlsChannelBindingType type, GByteArray *data, GError **error)
GTlsConnectionPrivate * priv
GIOStream parent_instance