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.TlsBackend;
28 public  import gio.TlsBackendIF;
29 public  import gio.TlsDatabase;
30 public  import gobject.ObjectG;
31 public  import gtkc.gio;
32 public  import gtkc.giotypes;
33 
34 
35 /**
36  * TLS (Transport Layer Security, aka SSL) backend. This is an
37  * internal type used to coordinate the different classes implemented
38  * by a TLS backend.
39  *
40  * Since: 2.28
41  */
42 public template TlsBackendT(TStruct)
43 {
44 	/** Get the main Gtk struct */
45 	public GTlsBackend* getTlsBackendStruct()
46 	{
47 		return cast(GTlsBackend*)getStruct();
48 	}
49 
50 	/**
51 	 */
52 
53 	/**
54 	 * Gets the default #GTlsBackend for the system.
55 	 *
56 	 * Return: a #GTlsBackend
57 	 *
58 	 * Since: 2.28
59 	 */
60 	public static TlsBackendIF getDefault()
61 	{
62 		auto p = g_tls_backend_get_default();
63 		
64 		if(p is null)
65 		{
66 			return null;
67 		}
68 		
69 		return ObjectG.getDObject!(TlsBackend, TlsBackendIF)(cast(GTlsBackend*) p);
70 	}
71 
72 	/**
73 	 * Gets the #GType of @backend's #GTlsCertificate implementation.
74 	 *
75 	 * Return: the #GType of @backend's #GTlsCertificate
76 	 *     implementation.
77 	 *
78 	 * Since: 2.28
79 	 */
80 	public GType getCertificateType()
81 	{
82 		return g_tls_backend_get_certificate_type(getTlsBackendStruct());
83 	}
84 
85 	/**
86 	 * Gets the #GType of @backend's #GTlsClientConnection implementation.
87 	 *
88 	 * Return: the #GType of @backend's #GTlsClientConnection
89 	 *     implementation.
90 	 *
91 	 * Since: 2.28
92 	 */
93 	public GType getClientConnectionType()
94 	{
95 		return g_tls_backend_get_client_connection_type(getTlsBackendStruct());
96 	}
97 
98 	/**
99 	 * Gets the default #GTlsDatabase used to verify TLS connections.
100 	 *
101 	 * Return: the default database, which should be
102 	 *     unreffed when done.
103 	 *
104 	 * Since: 2.30
105 	 */
106 	public TlsDatabase getDefaultDatabase()
107 	{
108 		auto p = g_tls_backend_get_default_database(getTlsBackendStruct());
109 		
110 		if(p is null)
111 		{
112 			return null;
113 		}
114 		
115 		return ObjectG.getDObject!(TlsDatabase)(cast(GTlsDatabase*) p, true);
116 	}
117 
118 	/**
119 	 * Gets the #GType of @backend's #GTlsFileDatabase implementation.
120 	 *
121 	 * Return: the #GType of backend's #GTlsFileDatabase implementation.
122 	 *
123 	 * Since: 2.30
124 	 */
125 	public GType getFileDatabaseType()
126 	{
127 		return g_tls_backend_get_file_database_type(getTlsBackendStruct());
128 	}
129 
130 	/**
131 	 * Gets the #GType of @backend's #GTlsServerConnection implementation.
132 	 *
133 	 * Return: the #GType of @backend's #GTlsServerConnection
134 	 *     implementation.
135 	 *
136 	 * Since: 2.28
137 	 */
138 	public GType getServerConnectionType()
139 	{
140 		return g_tls_backend_get_server_connection_type(getTlsBackendStruct());
141 	}
142 
143 	/**
144 	 * Checks if TLS is supported; if this returns %FALSE for the default
145 	 * #GTlsBackend, it means no "real" TLS backend is available.
146 	 *
147 	 * Return: whether or not TLS is supported
148 	 *
149 	 * Since: 2.28
150 	 */
151 	public bool supportsTls()
152 	{
153 		return g_tls_backend_supports_tls(getTlsBackendStruct()) != 0;
154 	}
155 }