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 * Conversion parameters: 26 * inFile = GTlsFileDatabase.html 27 * outPack = gio 28 * outFile = TlsFileDatabase 29 * strct = GTlsFileDatabase 30 * realStrct= 31 * ctorStrct=GTlsDatabase 32 * clss = TlsFileDatabase 33 * interf = 34 * class Code: No 35 * interface Code: No 36 * template for: 37 * extend = GTlsDatabase 38 * implements: 39 * prefixes: 40 * - g_tls_file_database_ 41 * omit structs: 42 * omit prefixes: 43 * omit code: 44 * omit signals: 45 * imports: 46 * - glib.Str 47 * - glib.ErrorG 48 * - glib.GException 49 * structWrap: 50 * module aliases: 51 * local aliases: 52 * overrides: 53 */ 54 55 module gio.TlsFileDatabase; 56 57 public import gtkc.giotypes; 58 59 private import gtkc.gio; 60 private import glib.ConstructionException; 61 private import gobject.ObjectG; 62 63 private import glib.Str; 64 private import glib.ErrorG; 65 private import glib.GException; 66 67 68 private import gio.TlsDatabase; 69 70 /** 71 * GTlsFileDatabase is implemented by GTlsDatabase objects which load 72 * their certificate information from a file. It is an interface which 73 * TLS library specific subtypes implement. 74 */ 75 public class TlsFileDatabase : TlsDatabase 76 { 77 78 /** the main Gtk struct */ 79 protected GTlsFileDatabase* gTlsFileDatabase; 80 81 82 /** Get the main Gtk struct */ 83 public GTlsFileDatabase* getTlsFileDatabaseStruct() 84 { 85 return gTlsFileDatabase; 86 } 87 88 89 /** the main Gtk struct as a void* */ 90 protected override void* getStruct() 91 { 92 return cast(void*)gTlsFileDatabase; 93 } 94 95 /** 96 * Sets our main struct and passes it to the parent class 97 */ 98 public this (GTlsFileDatabase* gTlsFileDatabase) 99 { 100 super(cast(GTlsDatabase*)gTlsFileDatabase); 101 this.gTlsFileDatabase = gTlsFileDatabase; 102 } 103 104 protected override void setStruct(GObject* obj) 105 { 106 super.setStruct(obj); 107 gTlsFileDatabase = cast(GTlsFileDatabase*)obj; 108 } 109 110 /** 111 */ 112 113 /** 114 * Creates a new GTlsFileDatabase which uses anchor certificate authorities 115 * in anchors to verify certificate chains. 116 * The certificates in anchors must be PEM encoded. 117 * Since 2.30 118 * Params: 119 * anchors = filename of anchor certificate authorities. 120 * Throws: GException on failure. 121 * Throws: ConstructionException GTK+ fails to create the object. 122 */ 123 public this (string anchors) 124 { 125 // GTlsDatabase * g_tls_file_database_new (const gchar *anchors, GError **error); 126 GError* err = null; 127 128 auto p = g_tls_file_database_new(Str.toStringz(anchors), &err); 129 130 if (err !is null) 131 { 132 throw new GException( new ErrorG(err) ); 133 } 134 135 if(p is null) 136 { 137 throw new ConstructionException("null returned by g_tls_file_database_new(Str.toStringz(anchors), &err)"); 138 } 139 this(cast(GTlsFileDatabase*) p); 140 } 141 }