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 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 51 /** 52 * Gets the default #GTlsBackend for the system. 53 * 54 * Return: 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 * Return: 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 * Return: 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 * Return: 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 #GTlsFileDatabase implementation. 118 * 119 * Return: the #GType of backend's #GTlsFileDatabase implementation. 120 * 121 * Since: 2.30 122 */ 123 public GType getFileDatabaseType() 124 { 125 return g_tls_backend_get_file_database_type(getTlsBackendStruct()); 126 } 127 128 /** 129 * Gets the #GType of @backend's #GTlsServerConnection implementation. 130 * 131 * Return: the #GType of @backend's #GTlsServerConnection 132 * implementation. 133 * 134 * Since: 2.28 135 */ 136 public GType getServerConnectionType() 137 { 138 return g_tls_backend_get_server_connection_type(getTlsBackendStruct()); 139 } 140 141 /** 142 * Checks if TLS is supported; if this returns %FALSE for the default 143 * #GTlsBackend, it means no "real" TLS backend is available. 144 * 145 * Return: whether or not TLS is supported 146 * 147 * Since: 2.28 148 */ 149 public bool supportsTls() 150 { 151 return g_tls_backend_supports_tls(getTlsBackendStruct()) != 0; 152 } 153 }