1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19 
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 
25 module gio.TlsBackendT;
26 
27 public  import gio.TlsBackendIF;
28 public  import gio.TlsDatabase;
29 public  import gio.c.functions;
30 public  import gio.c.types;
31 public  import gobject.ObjectG;
32 public  import gtkc.giotypes;
33 
34 
35 /**
36  * TLS (Transport Layer Security, aka SSL) and DTLS backend.
37  *
38  * Since: 2.28
39  */
40 public template TlsBackendT(TStruct)
41 {
42 	/** Get the main Gtk struct */
43 	public GTlsBackend* getTlsBackendStruct(bool transferOwnership = false)
44 	{
45 		if (transferOwnership)
46 			ownedRef = false;
47 		return cast(GTlsBackend*)getStruct();
48 	}
49 
50 
51 	/**
52 	 * Gets the #GType of @backend's #GTlsCertificate implementation.
53 	 *
54 	 * Returns: the #GType of @backend's #GTlsCertificate
55 	 *     implementation.
56 	 *
57 	 * Since: 2.28
58 	 */
59 	public GType getCertificateType()
60 	{
61 		return g_tls_backend_get_certificate_type(getTlsBackendStruct());
62 	}
63 
64 	/**
65 	 * Gets the #GType of @backend's #GTlsClientConnection implementation.
66 	 *
67 	 * Returns: the #GType of @backend's #GTlsClientConnection
68 	 *     implementation.
69 	 *
70 	 * Since: 2.28
71 	 */
72 	public GType getClientConnectionType()
73 	{
74 		return g_tls_backend_get_client_connection_type(getTlsBackendStruct());
75 	}
76 
77 	/**
78 	 * Gets the default #GTlsDatabase used to verify TLS connections.
79 	 *
80 	 * Returns: the default database, which should be
81 	 *     unreffed when done.
82 	 *
83 	 * Since: 2.30
84 	 */
85 	public TlsDatabase getDefaultDatabase()
86 	{
87 		auto p = g_tls_backend_get_default_database(getTlsBackendStruct());
88 
89 		if(p is null)
90 		{
91 			return null;
92 		}
93 
94 		return ObjectG.getDObject!(TlsDatabase)(cast(GTlsDatabase*) p, true);
95 	}
96 
97 	/**
98 	 * Gets the #GType of @backend’s #GDtlsClientConnection implementation.
99 	 *
100 	 * Returns: the #GType of @backend’s #GDtlsClientConnection
101 	 *     implementation, or %G_TYPE_INVALID if this backend doesn’t support DTLS.
102 	 *
103 	 * Since: 2.48
104 	 */
105 	public GType getDtlsClientConnectionType()
106 	{
107 		return g_tls_backend_get_dtls_client_connection_type(getTlsBackendStruct());
108 	}
109 
110 	/**
111 	 * Gets the #GType of @backend’s #GDtlsServerConnection implementation.
112 	 *
113 	 * Returns: the #GType of @backend’s #GDtlsServerConnection
114 	 *     implementation, or %G_TYPE_INVALID if this backend doesn’t support DTLS.
115 	 *
116 	 * Since: 2.48
117 	 */
118 	public GType getDtlsServerConnectionType()
119 	{
120 		return g_tls_backend_get_dtls_server_connection_type(getTlsBackendStruct());
121 	}
122 
123 	/**
124 	 * Gets the #GType of @backend's #GTlsFileDatabase implementation.
125 	 *
126 	 * Returns: the #GType of backend's #GTlsFileDatabase implementation.
127 	 *
128 	 * Since: 2.30
129 	 */
130 	public GType getFileDatabaseType()
131 	{
132 		return g_tls_backend_get_file_database_type(getTlsBackendStruct());
133 	}
134 
135 	/**
136 	 * Gets the #GType of @backend's #GTlsServerConnection implementation.
137 	 *
138 	 * Returns: the #GType of @backend's #GTlsServerConnection
139 	 *     implementation.
140 	 *
141 	 * Since: 2.28
142 	 */
143 	public GType getServerConnectionType()
144 	{
145 		return g_tls_backend_get_server_connection_type(getTlsBackendStruct());
146 	}
147 
148 	/**
149 	 * Checks if DTLS is supported. DTLS support may not be available even if TLS
150 	 * support is available, and vice-versa.
151 	 *
152 	 * Returns: whether DTLS is supported
153 	 *
154 	 * Since: 2.48
155 	 */
156 	public bool supportsDtls()
157 	{
158 		return g_tls_backend_supports_dtls(getTlsBackendStruct()) != 0;
159 	}
160 
161 	/**
162 	 * Checks if TLS is supported; if this returns %FALSE for the default
163 	 * #GTlsBackend, it means no "real" TLS backend is available.
164 	 *
165 	 * Returns: whether or not TLS is supported
166 	 *
167 	 * Since: 2.28
168 	 */
169 	public bool supportsTls()
170 	{
171 		return g_tls_backend_supports_tls(getTlsBackendStruct()) != 0;
172 	}
173 }