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