File indexing completed on 2025-01-18 10:00:00
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 #ifndef __G_TLS_CONNECTION_H__
0022 #define __G_TLS_CONNECTION_H__
0023
0024 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
0025 #error "Only <gio/gio.h> can be included directly."
0026 #endif
0027
0028 #include <gio/giostream.h>
0029
0030 G_BEGIN_DECLS
0031
0032 #define G_TYPE_TLS_CONNECTION (g_tls_connection_get_type ())
0033 #define G_TLS_CONNECTION(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), G_TYPE_TLS_CONNECTION, GTlsConnection))
0034 #define G_TLS_CONNECTION_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), G_TYPE_TLS_CONNECTION, GTlsConnectionClass))
0035 #define G_IS_TLS_CONNECTION(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), G_TYPE_TLS_CONNECTION))
0036 #define G_IS_TLS_CONNECTION_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), G_TYPE_TLS_CONNECTION))
0037 #define G_TLS_CONNECTION_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), G_TYPE_TLS_CONNECTION, GTlsConnectionClass))
0038
0039 typedef struct _GTlsConnectionClass GTlsConnectionClass;
0040 typedef struct _GTlsConnectionPrivate GTlsConnectionPrivate;
0041
0042 struct _GTlsConnection {
0043 GIOStream parent_instance;
0044
0045 GTlsConnectionPrivate *priv;
0046 };
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061
0062 struct _GTlsConnectionClass
0063 {
0064 GIOStreamClass parent_class;
0065
0066
0067 gboolean ( *accept_certificate) (GTlsConnection *connection,
0068 GTlsCertificate *peer_cert,
0069 GTlsCertificateFlags errors);
0070
0071
0072 gboolean ( *handshake ) (GTlsConnection *conn,
0073 GCancellable *cancellable,
0074 GError **error);
0075
0076 void ( *handshake_async ) (GTlsConnection *conn,
0077 int io_priority,
0078 GCancellable *cancellable,
0079 GAsyncReadyCallback callback,
0080 gpointer user_data);
0081 gboolean ( *handshake_finish ) (GTlsConnection *conn,
0082 GAsyncResult *result,
0083 GError **error);
0084
0085 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
0086 gboolean ( *get_binding_data) (GTlsConnection *conn,
0087 GTlsChannelBindingType type,
0088 GByteArray *data,
0089 GError **error);
0090 G_GNUC_END_IGNORE_DEPRECATIONS
0091
0092 const gchar *(*get_negotiated_protocol) (GTlsConnection *conn);
0093
0094
0095
0096 gpointer padding[6];
0097 };
0098
0099 GIO_AVAILABLE_IN_ALL
0100 GType g_tls_connection_get_type (void) G_GNUC_CONST;
0101
0102 GIO_DEPRECATED
0103 void g_tls_connection_set_use_system_certdb (GTlsConnection *conn,
0104 gboolean use_system_certdb);
0105 GIO_DEPRECATED
0106 gboolean g_tls_connection_get_use_system_certdb (GTlsConnection *conn);
0107
0108 GIO_AVAILABLE_IN_ALL
0109 void g_tls_connection_set_database (GTlsConnection *conn,
0110 GTlsDatabase *database);
0111 GIO_AVAILABLE_IN_ALL
0112 GTlsDatabase * g_tls_connection_get_database (GTlsConnection *conn);
0113
0114 GIO_AVAILABLE_IN_ALL
0115 void g_tls_connection_set_certificate (GTlsConnection *conn,
0116 GTlsCertificate *certificate);
0117 GIO_AVAILABLE_IN_ALL
0118 GTlsCertificate *g_tls_connection_get_certificate (GTlsConnection *conn);
0119
0120 GIO_AVAILABLE_IN_ALL
0121 void g_tls_connection_set_interaction (GTlsConnection *conn,
0122 GTlsInteraction *interaction);
0123 GIO_AVAILABLE_IN_ALL
0124 GTlsInteraction * g_tls_connection_get_interaction (GTlsConnection *conn);
0125
0126 GIO_AVAILABLE_IN_ALL
0127 GTlsCertificate *g_tls_connection_get_peer_certificate (GTlsConnection *conn);
0128 GIO_AVAILABLE_IN_ALL
0129 GTlsCertificateFlags g_tls_connection_get_peer_certificate_errors (GTlsConnection *conn);
0130
0131 GIO_AVAILABLE_IN_ALL
0132 void g_tls_connection_set_require_close_notify (GTlsConnection *conn,
0133 gboolean require_close_notify);
0134 GIO_AVAILABLE_IN_ALL
0135 gboolean g_tls_connection_get_require_close_notify (GTlsConnection *conn);
0136
0137 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
0138 GIO_DEPRECATED_IN_2_60
0139 void g_tls_connection_set_rehandshake_mode (GTlsConnection *conn,
0140 GTlsRehandshakeMode mode);
0141 GIO_DEPRECATED_IN_2_60
0142 GTlsRehandshakeMode g_tls_connection_get_rehandshake_mode (GTlsConnection *conn);
0143 G_GNUC_END_IGNORE_DEPRECATIONS
0144
0145 GIO_AVAILABLE_IN_2_60
0146 void g_tls_connection_set_advertised_protocols (GTlsConnection *conn,
0147 const gchar * const *protocols);
0148
0149 GIO_AVAILABLE_IN_2_60
0150 const gchar * g_tls_connection_get_negotiated_protocol (GTlsConnection *conn);
0151
0152 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
0153 GIO_AVAILABLE_IN_2_66
0154 gboolean g_tls_connection_get_channel_binding_data (GTlsConnection *conn,
0155 GTlsChannelBindingType type,
0156 GByteArray *data,
0157 GError **error);
0158 G_GNUC_END_IGNORE_DEPRECATIONS
0159
0160 GIO_AVAILABLE_IN_ALL
0161 gboolean g_tls_connection_handshake (GTlsConnection *conn,
0162 GCancellable *cancellable,
0163 GError **error);
0164
0165 GIO_AVAILABLE_IN_ALL
0166 void g_tls_connection_handshake_async (GTlsConnection *conn,
0167 int io_priority,
0168 GCancellable *cancellable,
0169 GAsyncReadyCallback callback,
0170 gpointer user_data);
0171 GIO_AVAILABLE_IN_ALL
0172 gboolean g_tls_connection_handshake_finish (GTlsConnection *conn,
0173 GAsyncResult *result,
0174 GError **error);
0175
0176 GIO_AVAILABLE_IN_2_70
0177 GTlsProtocolVersion g_tls_connection_get_protocol_version (GTlsConnection *conn);
0178
0179 GIO_AVAILABLE_IN_2_70
0180 gchar * g_tls_connection_get_ciphersuite_name (GTlsConnection *conn);
0181
0182
0183
0184
0185
0186
0187
0188
0189 #define G_TLS_ERROR (g_tls_error_quark ())
0190 GIO_AVAILABLE_IN_ALL
0191 GQuark g_tls_error_quark (void);
0192
0193
0194
0195
0196
0197
0198
0199
0200
0201
0202 #define G_TLS_CHANNEL_BINDING_ERROR (g_tls_channel_binding_error_quark ())
0203 GIO_AVAILABLE_IN_2_66
0204 GQuark g_tls_channel_binding_error_quark (void);
0205
0206
0207 GIO_AVAILABLE_IN_ALL
0208 gboolean g_tls_connection_emit_accept_certificate (GTlsConnection *conn,
0209 GTlsCertificate *peer_cert,
0210 GTlsCertificateFlags errors);
0211
0212 G_END_DECLS
0213
0214 #endif