[seahorse] pkcs11: Add 'exportable' property to SeahorsePrivateKey



commit 6f7af07da7dcaeee08c52baf13905d86437b6476
Author: Stef Walter <stefw collabora co uk>
Date:   Fri Dec 9 14:04:46 2011 +0100

    pkcs11: Add 'exportable' property to SeahorsePrivateKey
    
     * And also add the SeahorseExportable interface, but no private
       key exporters yet. No time to implement at this point.

 pkcs11/seahorse-private-key.c |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)
---
diff --git a/pkcs11/seahorse-private-key.c b/pkcs11/seahorse-private-key.c
index f3224c6..45bf02f 100644
--- a/pkcs11/seahorse-private-key.c
+++ b/pkcs11/seahorse-private-key.c
@@ -31,6 +31,7 @@
 #include "seahorse-types.h"
 
 #include "seahorse-deletable.h"
+#include "seahorse-exportable.h"
 #include "seahorse-util.h"
 
 #include <gcr/gcr.h>
@@ -56,6 +57,7 @@ enum {
 	PROP_ACTIONS,
 	PROP_PARTNER,
 
+	PROP_EXPORTABLE,
 	PROP_DELETABLE,
 	PROP_LABEL,
 	PROP_MARKUP,
@@ -73,11 +75,14 @@ struct _SeahorsePrivateKeyPrivate {
 
 static void seahorse_private_key_deletable_iface (SeahorseDeletableIface *iface);
 
+static void seahorse_private_key_exportable_iface (SeahorseExportableIface *iface);
+
 static void seahorse_private_key_object_cache_iface (GckObjectCacheIface *iface);
 
 G_DEFINE_TYPE_WITH_CODE (SeahorsePrivateKey, seahorse_private_key, GCK_TYPE_OBJECT,
                          G_IMPLEMENT_INTERFACE (GCK_TYPE_OBJECT_CACHE, seahorse_private_key_object_cache_iface);
                          G_IMPLEMENT_INTERFACE (SEAHORSE_TYPE_DELETABLE, seahorse_private_key_deletable_iface);
+                         G_IMPLEMENT_INTERFACE (SEAHORSE_TYPE_EXPORTABLE, seahorse_private_key_exportable_iface);
 );
 
 static void
@@ -163,6 +168,9 @@ seahorse_private_key_get_property (GObject *obj,
 	case PROP_MARKUP:
 		g_value_take_string (value, calculate_markup (self));
 		break;
+	case PROP_EXPORTABLE:
+		g_value_set_boolean (value, FALSE);
+		break;
 	case PROP_DELETABLE:
 		g_value_set_boolean (value, seahorse_token_is_deletable (self->pv->token, GCK_OBJECT (self)));
 		break;
@@ -255,6 +263,8 @@ seahorse_private_key_class_init (SeahorsePrivateKeyClass *klass)
 
 	g_object_class_override_property (gobject_class, PROP_ATTRIBUTES, "attributes");
 
+	g_object_class_override_property (gobject_class, PROP_EXPORTABLE, "exportable");
+
 	g_object_class_override_property (gobject_class, PROP_DELETABLE, "deletable");
 }
 
@@ -298,6 +308,20 @@ seahorse_private_key_deletable_iface (SeahorseDeletableIface *iface)
 	iface->create_deleter = seahorse_private_key_create_deleter;
 }
 
+static GList *
+seahorse_private_key_create_exporters (SeahorseExportable *exportable,
+                                       SeahorseExporterType type)
+{
+	/* In the future we may exporters here, but for now no exporting */
+	return NULL;
+}
+
+static void
+seahorse_private_key_exportable_iface (SeahorseExportableIface *iface)
+{
+	iface->create_exporters = seahorse_private_key_create_exporters;
+}
+
 SeahorseCertificate *
 seahorse_private_key_get_partner (SeahorsePrivateKey *self)
 {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]