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) 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() 44 { 45 return cast(GTlsBackend*)getStruct(); 46 } 47 48 49 /** 50 * Gets the default #GTlsBackend for the system. 51 * 52 * Return: a #GTlsBackend 53 * 54 * Since: 2.28 55 */ 56 public static TlsBackendIF getDefault() 57 { 58 auto p = g_tls_backend_get_default(); 59 60 if(p is null) 61 { 62 return null; 63 } 64 65 return ObjectG.getDObject!(TlsBackend, TlsBackendIF)(cast(GTlsBackend*) p); 66 } 67 68 /** 69 * Gets the #GType of @backend's #GTlsCertificate implementation. 70 * 71 * Return: the #GType of @backend's #GTlsCertificate 72 * implementation. 73 * 74 * Since: 2.28 75 */ 76 public GType getCertificateType() 77 { 78 return g_tls_backend_get_certificate_type(getTlsBackendStruct()); 79 } 80 81 /** 82 * Gets the #GType of @backend's #GTlsClientConnection implementation. 83 * 84 * Return: the #GType of @backend's #GTlsClientConnection 85 * implementation. 86 * 87 * Since: 2.28 88 */ 89 public GType getClientConnectionType() 90 { 91 return g_tls_backend_get_client_connection_type(getTlsBackendStruct()); 92 } 93 94 /** 95 * Gets the default #GTlsDatabase used to verify TLS connections. 96 * 97 * Return: the default database, which should be 98 * unreffed when done. 99 * 100 * Since: 2.30 101 */ 102 public TlsDatabase getDefaultDatabase() 103 { 104 auto p = g_tls_backend_get_default_database(getTlsBackendStruct()); 105 106 if(p is null) 107 { 108 return null; 109 } 110 111 return ObjectG.getDObject!(TlsDatabase)(cast(GTlsDatabase*) p, true); 112 } 113 114 /** 115 * Gets the #GType of @backend’s #GDtlsClientConnection implementation. 116 * 117 * Return: the #GType of @backend’s #GDtlsClientConnection 118 * implementation. 119 * 120 * Since: 2.48 121 */ 122 public GType getDtlsClientConnectionType() 123 { 124 return g_tls_backend_get_dtls_client_connection_type(getTlsBackendStruct()); 125 } 126 127 /** 128 * Gets the #GType of @backend’s #GDtlsServerConnection implementation. 129 * 130 * Return: the #GType of @backend’s #GDtlsServerConnection 131 * implementation. 132 * 133 * Since: 2.48 134 */ 135 public GType getDtlsServerConnectionType() 136 { 137 return g_tls_backend_get_dtls_server_connection_type(getTlsBackendStruct()); 138 } 139 140 /** 141 * Gets the #GType of @backend's #GTlsFileDatabase implementation. 142 * 143 * Return: the #GType of backend's #GTlsFileDatabase implementation. 144 * 145 * Since: 2.30 146 */ 147 public GType getFileDatabaseType() 148 { 149 return g_tls_backend_get_file_database_type(getTlsBackendStruct()); 150 } 151 152 /** 153 * Gets the #GType of @backend's #GTlsServerConnection implementation. 154 * 155 * Return: the #GType of @backend's #GTlsServerConnection 156 * implementation. 157 * 158 * Since: 2.28 159 */ 160 public GType getServerConnectionType() 161 { 162 return g_tls_backend_get_server_connection_type(getTlsBackendStruct()); 163 } 164 165 /** 166 * Checks if DTLS is supported. DTLS support may not be available even if TLS 167 * support is available, and vice-versa. 168 * 169 * Return: whether DTLS is supported 170 * 171 * Since: 2.48 172 */ 173 public bool supportsDtls() 174 { 175 return g_tls_backend_supports_dtls(getTlsBackendStruct()) != 0; 176 } 177 178 /** 179 * Checks if TLS is supported; if this returns %FALSE for the default 180 * #GTlsBackend, it means no "real" TLS backend is available. 181 * 182 * Return: whether or not TLS is supported 183 * 184 * Since: 2.28 185 */ 186 public bool supportsTls() 187 { 188 return g_tls_backend_supports_tls(getTlsBackendStruct()) != 0; 189 } 190 }