/* certificate-der-exporter.c generated by valac 0.20.1, the Vala compiler
 * generated from certificate-der-exporter.vala, do not modify */

/*
 * Seahorse
 *
 * Copyright (C) 2011 Collabora Ltd.
 * Copyright (C) 2012 Stefan Walter
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the
 * Free Software Foundation, Inc.,
 * 59 Temple Exporter, Suite 330,
 * Boston, MA 02111-1307, USA.
 *
 * Author: Stef Walter <stefw@collabora.co.uk>
 */

#include <glib.h>
#include <glib-object.h>
#include "seahorse-pkcs11.h"
#include <gcr/gcr-base.h>
#include <gio/gio.h>
#include <string.h>
#include <stdlib.h>
#include <glib/gi18n-lib.h>
#include <seahorse-common.h>
#include <gtk/gtk.h>

#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_list_free0(var) ((var == NULL) ? NULL : (var = (g_list_free (var), NULL)))
typedef struct _SeahorseCertificateDerExporterExportData SeahorseCertificateDerExporterExportData;
#define _g_free0(var) (var = (g_free (var), NULL))

struct _SeahorseCertificateDerExporterPrivate {
	GcrCertificate* _certificate;
	GList* _objects;
};

struct _SeahorseCertificateDerExporterExportData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	SeahorseCertificateDerExporter* self;
	GCancellable* cancellable;
	guchar* result;
	gint result_length1;
	GcrCertificate* _tmp0_;
	gsize _tmp1_;
	guint8* _tmp2_;
	guchar* _tmp3_;
	gint _tmp3__length1;
	guchar* _tmp4_;
	gint _tmp4__length1;
};


static gpointer seahorse_certificate_der_exporter_parent_class = NULL;
static SeahorseExporterIface* seahorse_certificate_der_exporter_seahorse_exporter_parent_iface = NULL;

#define SEAHORSE_CERTIFICATE_DER_EXPORTER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), SEAHORSE_TYPE_CERTIFICATE_DER_EXPORTER, SeahorseCertificateDerExporterPrivate))
enum  {
	SEAHORSE_CERTIFICATE_DER_EXPORTER_DUMMY_PROPERTY,
	SEAHORSE_CERTIFICATE_DER_EXPORTER_FILENAME,
	SEAHORSE_CERTIFICATE_DER_EXPORTER_CONTENT_TYPE,
	SEAHORSE_CERTIFICATE_DER_EXPORTER_FILE_FILTER
};
static GList* seahorse_certificate_der_exporter_real_get_objects (SeahorseExporter* base);
static gboolean seahorse_certificate_der_exporter_real_add_object (SeahorseExporter* base, GObject* obj);
static void seahorse_certificate_der_exporter_real_export_data_free (gpointer _data);
static void seahorse_certificate_der_exporter_real_export (SeahorseExporter* base, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean seahorse_certificate_der_exporter_real_export_co (SeahorseCertificateDerExporterExportData* _data_);
static guchar* _vala_array_dup1 (guchar* self, int length);
static void seahorse_certificate_der_exporter_finalize (GObject* obj);
static void _vala_seahorse_certificate_der_exporter_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);


static gpointer _g_object_ref0 (gpointer self) {
#line 33 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	return self ? g_object_ref (self) : NULL;
#line 92 "certificate-der-exporter.c"
}


SeahorseCertificateDerExporter* seahorse_certificate_der_exporter_construct (GType object_type, GcrCertificate* certificate) {
	SeahorseCertificateDerExporter * self = NULL;
	GcrCertificate* _tmp0_;
	GcrCertificate* _tmp1_;
	GcrCertificate* _tmp2_;
#line 31 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	g_return_val_if_fail (certificate != NULL, NULL);
#line 31 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	self = (SeahorseCertificateDerExporter*) g_object_new (object_type, NULL);
#line 33 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	_tmp0_ = certificate;
#line 33 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	_tmp1_ = _g_object_ref0 (_tmp0_);
#line 33 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	_g_object_unref0 (self->priv->_certificate);
#line 33 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	self->priv->_certificate = _tmp1_;
#line 34 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	_tmp2_ = certificate;
#line 34 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	self->priv->_objects = g_list_append (self->priv->_objects, (GObject*) _tmp2_);
#line 31 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	return self;
#line 119 "certificate-der-exporter.c"
}


SeahorseCertificateDerExporter* seahorse_certificate_der_exporter_new (GcrCertificate* certificate) {
#line 31 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	return seahorse_certificate_der_exporter_construct (SEAHORSE_TYPE_CERTIFICATE_DER_EXPORTER, certificate);
#line 126 "certificate-der-exporter.c"
}


static GList* seahorse_certificate_der_exporter_real_get_objects (SeahorseExporter* base) {
	SeahorseCertificateDerExporter * self;
	GList* result = NULL;
	GList* _tmp0_;
#line 73 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	self = (SeahorseCertificateDerExporter*) base;
#line 74 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	_tmp0_ = self->priv->_objects;
#line 74 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	result = _tmp0_;
#line 74 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	return result;
#line 142 "certificate-der-exporter.c"
}


static gboolean seahorse_certificate_der_exporter_real_add_object (SeahorseExporter* base, GObject* obj) {
	SeahorseCertificateDerExporter * self;
	gboolean result = FALSE;
#line 77 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	self = (SeahorseCertificateDerExporter*) base;
#line 77 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	g_return_val_if_fail (obj != NULL, FALSE);
#line 78 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	result = FALSE;
#line 78 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	return result;
#line 157 "certificate-der-exporter.c"
}


static void seahorse_certificate_der_exporter_real_export_data_free (gpointer _data) {
	SeahorseCertificateDerExporterExportData* _data_;
	_data_ = _data;
#line 27 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	_g_object_unref0 (_data_->cancellable);
#line 27 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	_data_->result = (g_free (_data_->result), NULL);
#line 27 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	_g_object_unref0 (_data_->self);
#line 27 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	g_slice_free (SeahorseCertificateDerExporterExportData, _data_);
#line 172 "certificate-der-exporter.c"
}


static void seahorse_certificate_der_exporter_real_export (SeahorseExporter* base, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	SeahorseCertificateDerExporter * self;
	SeahorseCertificateDerExporterExportData* _data_;
	SeahorseCertificateDerExporter* _tmp0_;
	GCancellable* _tmp1_;
	GCancellable* _tmp2_;
#line 27 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	self = (SeahorseCertificateDerExporter*) base;
#line 27 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	_data_ = g_slice_new0 (SeahorseCertificateDerExporterExportData);
#line 27 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, seahorse_certificate_der_exporter_real_export);
#line 27 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, seahorse_certificate_der_exporter_real_export_data_free);
#line 27 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 27 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	_data_->self = _tmp0_;
#line 27 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	_tmp1_ = cancellable;
#line 27 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	_tmp2_ = _g_object_ref0 (_tmp1_);
#line 27 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	_g_object_unref0 (_data_->cancellable);
#line 27 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	_data_->cancellable = _tmp2_;
#line 27 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	seahorse_certificate_der_exporter_real_export_co (_data_);
#line 204 "certificate-der-exporter.c"
}


static guchar* seahorse_certificate_der_exporter_real_export_finish (SeahorseExporter* base, GAsyncResult* _res_, int* result_length1, GError** error) {
	guchar* result;
	SeahorseCertificateDerExporterExportData* _data_;
#line 27 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
#line 27 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
		return NULL;
#line 215 "certificate-der-exporter.c"
	}
#line 27 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
#line 27 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	result = _data_->result;
#line 27 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	*result_length1 = _data_->result_length1;
#line 27 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	_data_->result = NULL;
#line 27 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	return result;
#line 227 "certificate-der-exporter.c"
}


static guchar* _vala_array_dup1 (guchar* self, int length) {
#line 83 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	return g_memdup (self, length * sizeof (guchar));
#line 234 "certificate-der-exporter.c"
}


static gboolean seahorse_certificate_der_exporter_real_export_co (SeahorseCertificateDerExporterExportData* _data_) {
#line 81 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	switch (_data_->_state_) {
#line 81 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
		case 0:
#line 243 "certificate-der-exporter.c"
		goto _state_0;
		default:
#line 81 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
		g_assert_not_reached ();
#line 248 "certificate-der-exporter.c"
	}
	_state_0:
#line 83 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	_data_->_tmp0_ = _data_->self->priv->_certificate;
#line 83 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	memset (&_data_->_tmp1_, 0, sizeof (gsize));
#line 83 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	_data_->_tmp2_ = NULL;
#line 83 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	_data_->_tmp2_ = gcr_certificate_get_der_data (_data_->_tmp0_, &_data_->_tmp1_);
#line 83 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	_data_->_tmp3_ = (_data_->_tmp2_ != NULL) ? _vala_array_dup1 (_data_->_tmp2_, _data_->_tmp1_) : ((gpointer) _data_->_tmp2_);
#line 83 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	_data_->_tmp3__length1 = _data_->_tmp1_;
#line 83 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	_data_->_tmp4_ = _data_->_tmp3_;
#line 83 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	_data_->_tmp4__length1 = _data_->_tmp3__length1;
#line 83 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	_data_->result_length1 = _data_->_tmp4__length1;
#line 83 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	_data_->result = _data_->_tmp4_;
#line 83 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	if (_data_->_state_ == 0) {
#line 83 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 275 "certificate-der-exporter.c"
	} else {
#line 83 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 279 "certificate-der-exporter.c"
	}
#line 83 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	g_object_unref (_data_->_async_result);
#line 83 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	return FALSE;
#line 81 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	if (_data_->_state_ == 0) {
#line 81 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 289 "certificate-der-exporter.c"
	} else {
#line 81 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 293 "certificate-der-exporter.c"
	}
#line 81 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	g_object_unref (_data_->_async_result);
#line 81 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	return FALSE;
#line 299 "certificate-der-exporter.c"
}


static gchar* string_delimit (const gchar* self, const gchar* delimiters, gchar new_delimiter) {
	gchar* result = NULL;
	gchar* _tmp0_ = NULL;
	gchar* _result_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar _tmp3_;
#line 1093 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, NULL);
#line 1093 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
	g_return_val_if_fail (delimiters != NULL, NULL);
#line 1094 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
	_tmp0_ = g_strdup (self);
#line 1094 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
	_result_ = _tmp0_;
#line 1095 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
	_tmp1_ = _result_;
#line 1095 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
	_tmp2_ = delimiters;
#line 1095 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
	_tmp3_ = new_delimiter;
#line 1095 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
	g_strdelimit (_tmp1_, _tmp2_, _tmp3_);
#line 1096 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
	result = _result_;
#line 1096 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
	return result;
#line 330 "certificate-der-exporter.c"
}


static gchar* seahorse_certificate_der_exporter_real_get_filename (SeahorseExporter* base) {
	gchar* result;
	SeahorseCertificateDerExporter* self;
	gchar* label;
	GcrCertificate* _tmp0_;
	const gchar* _tmp8_;
	const gchar* _tmp11_;
	gchar* _tmp12_;
	gchar* filename;
	gchar* _tmp13_ = NULL;
#line 38 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	self = (SeahorseCertificateDerExporter*) base;
#line 39 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	label = NULL;
#line 40 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	_tmp0_ = self->priv->_certificate;
#line 40 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	if (_tmp0_ != NULL) {
#line 352 "certificate-der-exporter.c"
		GcrCertificate* _tmp1_;
		gchar* _tmp2_ = NULL;
		gchar* _tmp3_;
		const gchar* _tmp4_;
#line 41 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
		_tmp1_ = self->priv->_certificate;
#line 41 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
		g_object_get (_tmp1_, "label", &_tmp2_, NULL);
#line 41 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
		_tmp3_ = _tmp2_;
#line 41 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
		_g_free0 (label);
#line 41 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
		label = _tmp3_;
#line 42 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
		_tmp4_ = label;
#line 42 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
		if (_tmp4_ == NULL) {
#line 371 "certificate-der-exporter.c"
			GcrCertificate* _tmp5_;
			gchar* _tmp6_ = NULL;
			gchar* _tmp7_;
#line 43 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
			_tmp5_ = self->priv->_certificate;
#line 43 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
			g_object_get (_tmp5_, "description", &_tmp6_, NULL);
#line 43 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
			_tmp7_ = _tmp6_;
#line 43 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
			_g_free0 (label);
#line 43 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
			label = _tmp7_;
#line 385 "certificate-der-exporter.c"
		}
	}
#line 45 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	_tmp8_ = label;
#line 45 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	if (_tmp8_ == NULL) {
#line 392 "certificate-der-exporter.c"
		const gchar* _tmp9_ = NULL;
		gchar* _tmp10_;
#line 46 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
		_tmp9_ = _ ("Certificate");
#line 46 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
		_tmp10_ = g_strdup (_tmp9_);
#line 46 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
		_g_free0 (label);
#line 46 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
		label = _tmp10_;
#line 403 "certificate-der-exporter.c"
	}
#line 48 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	_tmp11_ = label;
#line 48 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	_tmp12_ = g_strconcat (_tmp11_, ".crt", NULL);
#line 48 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	filename = _tmp12_;
#line 49 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	_tmp13_ = string_delimit (filename, SEAHORSE_BAD_FILENAME_CHARS, '_');
#line 49 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	result = _tmp13_;
#line 49 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	_g_free0 (filename);
#line 49 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	_g_free0 (label);
#line 49 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	return result;
#line 421 "certificate-der-exporter.c"
}


static const gchar* seahorse_certificate_der_exporter_real_get_content_type (SeahorseExporter* base) {
	const gchar* result;
	SeahorseCertificateDerExporter* self;
#line 54 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	self = (SeahorseCertificateDerExporter*) base;
#line 54 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	result = "application/pkix-cert";
#line 54 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	return result;
#line 434 "certificate-der-exporter.c"
}


static GtkFileFilter* seahorse_certificate_der_exporter_real_get_file_filter (SeahorseExporter* base) {
	GtkFileFilter* result;
	SeahorseCertificateDerExporter* self;
	GtkFileFilter* _tmp0_;
	GtkFileFilter* filter;
	const gchar* _tmp1_ = NULL;
#line 58 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	self = (SeahorseCertificateDerExporter*) base;
#line 59 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	_tmp0_ = gtk_file_filter_new ();
#line 59 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	g_object_ref_sink (_tmp0_);
#line 59 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	filter = _tmp0_;
#line 60 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	_tmp1_ = _ ("Certificates (DER encoded)");
#line 60 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	gtk_buildable_set_name ((GtkBuildable*) filter, _tmp1_);
#line 61 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	gtk_file_filter_add_mime_type (filter, "application/pkix-cert");
#line 62 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	gtk_file_filter_add_mime_type (filter, "application/x-x509-ca-cert");
#line 63 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	gtk_file_filter_add_mime_type (filter, "application/x-x509-user-cert");
#line 64 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	gtk_file_filter_add_pattern (filter, "*.cer");
#line 65 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	gtk_file_filter_add_pattern (filter, "*.crt");
#line 66 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	gtk_file_filter_add_pattern (filter, "*.cert");
#line 68 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	result = filter;
#line 68 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	return result;
#line 472 "certificate-der-exporter.c"
}


static void seahorse_certificate_der_exporter_class_init (SeahorseCertificateDerExporterClass * klass) {
#line 27 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	seahorse_certificate_der_exporter_parent_class = g_type_class_peek_parent (klass);
#line 27 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	g_type_class_add_private (klass, sizeof (SeahorseCertificateDerExporterPrivate));
#line 27 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	G_OBJECT_CLASS (klass)->get_property = _vala_seahorse_certificate_der_exporter_get_property;
#line 27 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	G_OBJECT_CLASS (klass)->finalize = seahorse_certificate_der_exporter_finalize;
#line 27 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), SEAHORSE_CERTIFICATE_DER_EXPORTER_FILENAME, g_param_spec_string ("filename", "filename", "filename", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
#line 27 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), SEAHORSE_CERTIFICATE_DER_EXPORTER_CONTENT_TYPE, g_param_spec_string ("content-type", "content-type", "content-type", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
#line 27 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), SEAHORSE_CERTIFICATE_DER_EXPORTER_FILE_FILTER, g_param_spec_object ("file-filter", "file-filter", "file-filter", GTK_TYPE_FILE_FILTER, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
#line 491 "certificate-der-exporter.c"
}


static void seahorse_certificate_der_exporter_seahorse_exporter_interface_init (SeahorseExporterIface * iface) {
#line 27 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	seahorse_certificate_der_exporter_seahorse_exporter_parent_iface = g_type_interface_peek_parent (iface);
#line 27 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	iface->get_objects = (GList* (*)(SeahorseExporter*)) seahorse_certificate_der_exporter_real_get_objects;
#line 27 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	iface->add_object = (gboolean (*)(SeahorseExporter*, GObject*)) seahorse_certificate_der_exporter_real_add_object;
#line 27 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	iface->export = (guchar* (*)(SeahorseExporter*, GCancellable*, size_t*, GError**)) seahorse_certificate_der_exporter_real_export;
#line 27 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	iface->export_finish = seahorse_certificate_der_exporter_real_export_finish;
#line 27 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	iface->get_filename = seahorse_certificate_der_exporter_real_get_filename;
#line 27 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	iface->get_content_type = seahorse_certificate_der_exporter_real_get_content_type;
#line 27 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	iface->get_file_filter = seahorse_certificate_der_exporter_real_get_file_filter;
#line 512 "certificate-der-exporter.c"
}


static void seahorse_certificate_der_exporter_instance_init (SeahorseCertificateDerExporter * self) {
#line 27 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	self->priv = SEAHORSE_CERTIFICATE_DER_EXPORTER_GET_PRIVATE (self);
#line 519 "certificate-der-exporter.c"
}


static void seahorse_certificate_der_exporter_finalize (GObject* obj) {
	SeahorseCertificateDerExporter * self;
#line 27 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SEAHORSE_TYPE_CERTIFICATE_DER_EXPORTER, SeahorseCertificateDerExporter);
#line 28 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	_g_object_unref0 (self->priv->_certificate);
#line 29 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	_g_list_free0 (self->priv->_objects);
#line 27 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	G_OBJECT_CLASS (seahorse_certificate_der_exporter_parent_class)->finalize (obj);
#line 533 "certificate-der-exporter.c"
}


GType seahorse_certificate_der_exporter_get_type (void) {
	static volatile gsize seahorse_certificate_der_exporter_type_id__volatile = 0;
	if (g_once_init_enter (&seahorse_certificate_der_exporter_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (SeahorseCertificateDerExporterClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) seahorse_certificate_der_exporter_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SeahorseCertificateDerExporter), 0, (GInstanceInitFunc) seahorse_certificate_der_exporter_instance_init, NULL };
		static const GInterfaceInfo seahorse_exporter_info = { (GInterfaceInitFunc) seahorse_certificate_der_exporter_seahorse_exporter_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		GType seahorse_certificate_der_exporter_type_id;
		seahorse_certificate_der_exporter_type_id = g_type_register_static (G_TYPE_OBJECT, "SeahorseCertificateDerExporter", &g_define_type_info, 0);
		g_type_add_interface_static (seahorse_certificate_der_exporter_type_id, SEAHORSE_TYPE_EXPORTER, &seahorse_exporter_info);
		g_once_init_leave (&seahorse_certificate_der_exporter_type_id__volatile, seahorse_certificate_der_exporter_type_id);
	}
	return seahorse_certificate_der_exporter_type_id__volatile;
}


static void _vala_seahorse_certificate_der_exporter_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	SeahorseCertificateDerExporter * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SEAHORSE_TYPE_CERTIFICATE_DER_EXPORTER, SeahorseCertificateDerExporter);
#line 27 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
	switch (property_id) {
#line 27 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
		case SEAHORSE_CERTIFICATE_DER_EXPORTER_FILENAME:
#line 27 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
		g_value_take_string (value, seahorse_exporter_get_filename ((SeahorseExporter*) self));
#line 27 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
		break;
#line 27 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
		case SEAHORSE_CERTIFICATE_DER_EXPORTER_CONTENT_TYPE:
#line 27 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
		g_value_set_string (value, seahorse_exporter_get_content_type ((SeahorseExporter*) self));
#line 27 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
		break;
#line 27 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
		case SEAHORSE_CERTIFICATE_DER_EXPORTER_FILE_FILTER:
#line 27 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
		g_value_take_object (value, seahorse_exporter_get_file_filter ((SeahorseExporter*) self));
#line 27 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
		break;
#line 574 "certificate-der-exporter.c"
		default:
#line 27 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
#line 27 "/data/projects/seahorse/pkcs11/certificate-der-exporter.vala"
		break;
#line 580 "certificate-der-exporter.c"
	}
}



