diff --git a/docs/reference/gcr/gcr-sections.txt b/docs/reference/gcr/gcr-sections.txt
index 2f652b9..b28a131 100644
--- a/docs/reference/gcr/gcr-sections.txt
+++ b/docs/reference/gcr/gcr-sections.txt
@@ -435,6 +435,7 @@ GcrUnlockOptionsWidgetPrivate
 <SUBSECTION Private>
 GCR_COLONS_SCHEMA_PUB
 GCR_COLONS_SCHEMA_UID
+GCR_COLONS_SCHEMA_SEC
 GCR_GNUPG_COLLECTION
 GCR_GNUPG_COLLECTION_CLASS
 GCR_GNUPG_COLLECTION_GET_CLASS
@@ -451,6 +452,7 @@ GCR_TYPE_GNUPG_KEY
 GcrColonColumns
 GcrColonPubColumns
 GcrColonUidColumns
+GcrColonSecColumns
 GcrColons
 GcrGnupgCollection
 GcrGnupgCollectionClass
diff --git a/gcr/gcr-colons.h b/gcr/gcr-colons.h
index 5333998..ac89681 100644
--- a/gcr/gcr-colons.h
+++ b/gcr/gcr-colons.h
@@ -52,6 +52,7 @@ G_BEGIN_DECLS
 
 #define GCR_COLONS_SCHEMA_UID  (g_quark_from_static_string ("uid"))
 #define GCR_COLONS_SCHEMA_PUB  (g_quark_from_static_string ("pub"))
+#define GCR_COLONS_SCHEMA_SEC  (g_quark_from_static_string ("sec"))
 
 /* Common columns for all schemas */
 typedef enum {
@@ -67,6 +68,14 @@ typedef enum {
 } GcrColonPubColumns;
 
 /*
+ * Columns for sec schema, add them as they're used. eg:
+ * sec::2048:1:293FC71A513189BD:1299771018::::::::::
+ */
+typedef enum {
+	GCR_COLONS_SEC_KEYID = 4
+} GcrColonSecColumns;
+
+/*
  * Columns for uid schema, add them as they're used. eg:
  * pub:f:1024:17:6C7EE1B8621CC013:899817715:1055898235::m:::scESC:
  */
diff --git a/gcr/gcr-gnupg-collection.c b/gcr/gcr-gnupg-collection.c
index c6accf4..3f82e24 100644
--- a/gcr/gcr-gnupg-collection.c
+++ b/gcr/gcr-gnupg-collection.c
@@ -41,11 +41,17 @@ enum {
 	PROP_MAIN_CONTEXT
 };
 
+enum {
+	PHASE_PUBLIC_KEYS = 1,
+	PHASE_SECRET_KEYS = 2,
+};
+
 struct _GcrGnupgCollectionPrivate {
-	GHashTable *items;          /* Map of char *keyid -> GcrGnupgKey *key */
+	GHashTable *items;          /* char *keyid -> GcrGnupgKey* */
 	gchar *directory;
 };
 
+/* Forward declarations */
 static void _gcr_collection_iface (GcrCollectionIface *iface);
 
 G_DEFINE_TYPE_WITH_CODE (GcrGnupgCollection, _gcr_gnupg_collection, G_TYPE_OBJECT,
@@ -192,6 +198,7 @@ _gcr_gnupg_collection_new (const gchar *directory)
 
 typedef struct {
 	GcrGnupgCollection *collection;       /* reffed pointer back to collection */
+	gint loading_phase;
 	GPtrArray *dataset;                   /* GcrColons* not yet made into a key */
 	guint spawn_sig;
 	guint child_sig;
@@ -201,6 +208,9 @@ typedef struct {
 	GHashTable *difference;               /* Hashset gchar *keyid -> gchar *keyid */
 } GcrGnupgCollectionLoad;
 
+/* Forward declarations */
+static void spawn_gnupg_list_process (GcrGnupgCollectionLoad *load, GSimpleAsyncResult *res);
+
 static void
 _gcr_gnupg_collection_load_free (gpointer data)
 {
@@ -225,11 +235,51 @@ _gcr_gnupg_collection_load_free (gpointer data)
 }
 
 static void
+process_dataset_as_public_key (GcrGnupgCollectionLoad *load, GPtrArray *dataset,
+                               const gchar *keyid)
+{
+	GcrGnupgKey *key;
+
+	/* Note that we've seen this keyid */
+	g_hash_table_remove (load->difference, keyid);
+
+	key = g_hash_table_lookup (load->collection->pv->items, keyid);
+
+	/* Already have this key, just update */
+	if (key) {
+		_gcr_gnupg_key_set_public_dataset (key, dataset);
+
+	/* Add a new key */
+	} else {
+		key = _gcr_gnupg_key_new (dataset, NULL);
+		g_hash_table_insert (load->collection->pv->items, g_strdup (keyid), key);
+		gcr_collection_emit_added (GCR_COLLECTION (load->collection), G_OBJECT (key));
+	}
+}
+
+static void
+process_dataset_as_secret_key (GcrGnupgCollectionLoad *load, GPtrArray *dataset,
+                               const gchar *keyid)
+{
+	GcrGnupgKey *key;
+
+	key = g_hash_table_lookup (load->collection->pv->items, keyid);
+
+	/* Don't have this key */
+	if (key == NULL)
+		g_message ("secret key seen but no public key for: %s", keyid);
+
+	/* Tell the private key that it's a secret one */
+	else
+		_gcr_gnupg_key_set_secret_dataset (key, dataset);
+}
+
+static void
 process_dataset_as_key (GcrGnupgCollectionLoad *load)
 {
-	const gchar *keyid;
 	GPtrArray *dataset;
-	GcrGnupgKey *key;
+	const gchar *keyid;
+	GQuark schema;
 
 	g_assert (load->dataset->len);
 
@@ -238,21 +288,18 @@ process_dataset_as_key (GcrGnupgCollectionLoad *load)
 
 	keyid = _gcr_gnupg_key_get_keyid_for_colons (dataset);
 	if (keyid) {
-		/* Note that we've seen this keyid */
-		g_hash_table_remove (load->difference, keyid);
+		schema = _gcr_colons_get_schema (dataset->pdata[0]);
 
-		key = g_hash_table_lookup (load->collection->pv->items, keyid);
+		/* A public key */
+		if (schema == GCR_COLONS_SCHEMA_PUB)
+			process_dataset_as_public_key (load, dataset, keyid);
 
-		/* Already have this key, just update */
-		if (key) {
-			_gcr_gnupg_key_set_dataset (key, dataset);
+		/* A secret key */
+		else if (schema == GCR_COLONS_SCHEMA_SEC)
+			process_dataset_as_secret_key (load, dataset, keyid);
 
-		/* Add a new key */
-		} else {
-			key = _gcr_gnupg_key_new (dataset);
-			g_hash_table_insert (load->collection->pv->items, g_strdup (keyid), key);
-			gcr_collection_emit_added (GCR_COLLECTION (load->collection), G_OBJECT (key));
-		}
+		else
+			g_assert_not_reached ();
 
 	} else {
 		g_warning ("parsed gnupg data had no keyid");
@@ -277,10 +324,10 @@ on_line_parse_output (const gchar *line, gpointer user_data)
 	schema = _gcr_colons_get_schema (colons);
 
 	/*
-	 * Each time we see a line with 'pub' schema we assume that it's
-	 * a new key being listed.
+	 * Each time we see a line with 'pub' or 'sec' schema we assume that
+	 * it's a new key being listed.
 	 */
-	if (schema == GCR_COLONS_SCHEMA_PUB) {
+	if (schema == GCR_COLONS_SCHEMA_PUB || schema == GCR_COLONS_SCHEMA_SEC) {
 		if (load->dataset->len)
 			process_dataset_as_key (load);
 		g_assert (!load->dataset->len);
@@ -371,6 +418,19 @@ on_spawn_completed (gpointer user_data)
 	if (load->dataset->len)
 		process_dataset_as_key (load);
 
+	/* If we completed loading public keys, then go and load secret */
+	switch (load->loading_phase) {
+	case PHASE_PUBLIC_KEYS:
+		load->loading_phase = PHASE_SECRET_KEYS;
+		spawn_gnupg_list_process (load, res);
+		return;
+	case PHASE_SECRET_KEYS:
+		/* continue below */
+		break;
+	default:
+		g_assert_not_reached ();
+	}
+
 	/* Remove any keys that we still have in the difference */
 	g_hash_table_iter_init (&iter, load->difference);
 	while (g_hash_table_iter_next (&iter, &keyid, NULL)) {
@@ -419,6 +479,61 @@ static EggSpawnCallbacks spawn_callbacks = {
 	NULL
 };
 
+static void
+spawn_gnupg_list_process (GcrGnupgCollectionLoad *load, GSimpleAsyncResult *res)
+{
+	GError *error = NULL;
+	GPtrArray *argv;
+
+	argv = g_ptr_array_new ();
+	g_ptr_array_add (argv, (gpointer)GPG_EXECUTABLE);
+
+	switch (load->loading_phase) {
+	case PHASE_PUBLIC_KEYS:
+		g_ptr_array_add (argv, (gpointer)"--list-keys");
+		break;
+	case PHASE_SECRET_KEYS:
+		g_ptr_array_add (argv, (gpointer)"--list-secret-keys");
+		break;
+	default:
+		g_assert_not_reached ();
+	}
+
+	g_ptr_array_add (argv, (gpointer)"--fixed-list-mode");
+	g_ptr_array_add (argv, (gpointer)"--with-colons");
+	if (load->collection->pv->directory) {
+		g_ptr_array_add (argv, (gpointer)"--homedir");
+		g_ptr_array_add (argv, (gpointer)load->collection->pv->directory);
+	}
+	g_ptr_array_add (argv, NULL);
+
+	g_assert (!load->spawn_sig);
+	g_assert (!load->gnupg_pid);
+
+	load->spawn_sig = egg_spawn_async_with_callbacks (load->collection->pv->directory,
+	                                                  (gchar**)argv->pdata, NULL,
+	                                                  G_SPAWN_DO_NOT_REAP_CHILD,
+	                                                  &load->gnupg_pid,
+	                                                  &spawn_callbacks,
+	                                                  g_object_ref (res),
+	                                                  NULL, &error);
+
+	if (error) {
+		g_simple_async_result_set_from_error (res, error);
+		g_simple_async_result_complete_in_idle (res);
+		g_clear_error (&error);
+	} else {
+		g_assert (!load->child_sig);
+		load->child_sig = g_child_watch_add_full (G_PRIORITY_DEFAULT,
+		                                          load->gnupg_pid,
+		                                          on_child_exited,
+		                                          g_object_ref (res),
+		                                          g_object_unref);
+	}
+
+	g_ptr_array_unref (argv);
+}
+
 /**
  * _gcr_gnupg_collection_load_async:
  * @self: The collection
@@ -435,8 +550,6 @@ _gcr_gnupg_collection_load_async (GcrGnupgCollection *self, GCancellable *cancel
 {
 	GSimpleAsyncResult *res;
 	GcrGnupgCollectionLoad *load;
-	GError *error = NULL;
-	GPtrArray *argv;
 	GHashTableIter iter;
 	gpointer keyid;
 
@@ -444,17 +557,6 @@ _gcr_gnupg_collection_load_async (GcrGnupgCollection *self, GCancellable *cancel
 
 	/* TODO: Cancellation not yet implemented */
 
-	argv = g_ptr_array_new ();
-	g_ptr_array_add (argv, (gpointer)GPG_EXECUTABLE);
-	g_ptr_array_add (argv, (gpointer)"--list-keys");
-	g_ptr_array_add (argv, (gpointer)"--fixed-list-mode");
-	g_ptr_array_add (argv, (gpointer)"--with-colons");
-	if (self->pv->directory) {
-		g_ptr_array_add (argv, (gpointer)"--homedir");
-		g_ptr_array_add (argv, (gpointer)self->pv->directory);
-	}
-	g_ptr_array_add (argv, NULL);
-
 	res = g_simple_async_result_new (G_OBJECT (self), callback, user_data,
 	                                 _gcr_gnupg_collection_load_async);
 
@@ -476,28 +578,10 @@ _gcr_gnupg_collection_load_async (GcrGnupgCollection *self, GCancellable *cancel
 	g_simple_async_result_set_op_res_gpointer (res, load,
 	                                           _gcr_gnupg_collection_load_free);
 
-	load->spawn_sig = egg_spawn_async_with_callbacks (self->pv->directory,
-	                                                  (gchar**)argv->pdata, NULL,
-	                                                  G_SPAWN_DO_NOT_REAP_CHILD,
-	                                                  &load->gnupg_pid,
-	                                                  &spawn_callbacks,
-	                                                  g_object_ref (res),
-	                                                  NULL, &error);
-
-	if (error) {
-		g_simple_async_result_set_from_error (res, error);
-		g_simple_async_result_complete_in_idle (res);
-		g_clear_error (&error);
-	} else {
-		load->child_sig = g_child_watch_add_full (G_PRIORITY_DEFAULT,
-		                                          load->gnupg_pid,
-		                                          on_child_exited,
-		                                          g_object_ref (res),
-		                                          g_object_unref);
-	}
+	load->loading_phase = PHASE_PUBLIC_KEYS;
+	spawn_gnupg_list_process (load, res);
 
 	g_object_unref (res);
-	g_ptr_array_unref (argv);
 }
 
 /**
diff --git a/gcr/gcr-gnupg-key.c b/gcr/gcr-gnupg-key.c
index 874a3ba..2f078e2 100644
--- a/gcr/gcr-gnupg-key.c
+++ b/gcr/gcr-gnupg-key.c
@@ -31,7 +31,8 @@
 
 enum {
 	PROP_0,
-	PROP_DATASET,
+	PROP_PUBLIC_DATASET,
+	PROP_SECRET_DATASET,
 	PROP_LABEL,
 	PROP_MARKUP,
 	PROP_DESCRIPTION,
@@ -39,7 +40,8 @@ enum {
 };
 
 struct _GcrGnupgKeyPrivate {
-	GPtrArray *dataset;
+	GPtrArray *public_dataset;
+	GPtrArray *secret_dataset;
 };
 
 G_DEFINE_TYPE (GcrGnupgKey, _gcr_gnupg_key, G_TYPE_OBJECT);
@@ -53,7 +55,7 @@ calculate_name (GcrGnupgKey *self)
 {
 	GcrColons* colons;
 
-	colons = _gcr_colons_find (self->pv->dataset, GCR_COLONS_SCHEMA_UID);
+	colons = _gcr_colons_find (self->pv->public_dataset, GCR_COLONS_SCHEMA_UID);
 	g_return_val_if_fail (colons, NULL);
 
 	return _gcr_colons_get_string (colons, GCR_COLONS_UID_NAME);
@@ -79,7 +81,7 @@ calculate_keyid (GcrGnupgKey *self)
 	const gchar *keyid;
 	gsize length;
 
-	keyid = _gcr_gnupg_key_get_keyid_for_colons (self->pv->dataset);
+	keyid = _gcr_gnupg_key_get_keyid_for_colons (self->pv->public_dataset);
 	if (keyid == NULL)
 		return NULL;
 
@@ -101,8 +103,10 @@ _gcr_gnupg_key_finalize (GObject *obj)
 {
 	GcrGnupgKey *self = GCR_GNUPG_KEY (obj);
 
-	if (self->pv->dataset)
-		g_ptr_array_free (self->pv->dataset, TRUE);
+	if (self->pv->public_dataset)
+		g_ptr_array_free (self->pv->public_dataset, TRUE);
+	if (self->pv->secret_dataset)
+		g_ptr_array_free (self->pv->secret_dataset, TRUE);
 
 	G_OBJECT_CLASS (_gcr_gnupg_key_parent_class)->finalize (obj);
 }
@@ -114,8 +118,11 @@ _gcr_gnupg_key_set_property (GObject *obj, guint prop_id, const GValue *value,
 	GcrGnupgKey *self = GCR_GNUPG_KEY (obj);
 
 	switch (prop_id) {
-	case PROP_DATASET:
-		_gcr_gnupg_key_set_dataset (self, g_value_get_boxed (value));
+	case PROP_PUBLIC_DATASET:
+		_gcr_gnupg_key_set_public_dataset (self, g_value_get_boxed (value));
+		break;
+	case PROP_SECRET_DATASET:
+		_gcr_gnupg_key_set_secret_dataset (self, g_value_get_boxed (value));
 		break;
 	default:
 		G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec);
@@ -130,8 +137,11 @@ _gcr_gnupg_key_get_property (GObject *obj, guint prop_id, GValue *value,
 	GcrGnupgKey *self = GCR_GNUPG_KEY (obj);
 
 	switch (prop_id) {
-	case PROP_DATASET:
-		g_value_set_boxed (value, self->pv->dataset);
+	case PROP_PUBLIC_DATASET:
+		g_value_set_boxed (value, self->pv->public_dataset);
+		break;
+	case PROP_SECRET_DATASET:
+		g_value_set_boxed (value, self->pv->secret_dataset);
 		break;
 	case PROP_LABEL:
 		g_value_take_string (value, calculate_name (self));
@@ -163,8 +173,12 @@ _gcr_gnupg_key_class_init (GcrGnupgKeyClass *klass)
 	gobject_class->set_property = _gcr_gnupg_key_set_property;
 	gobject_class->get_property = _gcr_gnupg_key_get_property;
 
-	g_object_class_install_property (gobject_class, PROP_DATASET,
-	         g_param_spec_boxed ("dataset", "Dataset", "Colon Dataset",
+	g_object_class_install_property (gobject_class, PROP_PUBLIC_DATASET,
+	         g_param_spec_boxed ("public-dataset", "Public Dataset", "Public Key Colon Dataset",
+	                             G_TYPE_PTR_ARRAY, G_PARAM_READWRITE));
+
+	g_object_class_install_property (gobject_class, PROP_SECRET_DATASET,
+	         g_param_spec_boxed ("secret-dataset", "Secret Dataset", "Secret Key Colon Dataset",
 	                             G_TYPE_PTR_ARRAY, G_PARAM_READWRITE));
 
 	g_object_class_install_property (gobject_class, PROP_LABEL,
@@ -186,22 +200,27 @@ _gcr_gnupg_key_class_init (GcrGnupgKeyClass *klass)
 
 /**
  * _gcr_gnupg_key_new:
- * @dataset: array of GcrColons*
+ * @pubset: array of GcrColons* representing public part of key
+ * @secset: optional array of GcrColons* representing secret part of key.
  *
- * Create a new GcrGnupgKey for the colons data passed.
+ * Create a new GcrGnupgKey for the colons data passed. If the secret part
+ * of the key is set, then this represents a secret key.
  *
  * Returns: A newly allocated key, which should be released with
  *     g_object_unref().
  */
 GcrGnupgKey*
-_gcr_gnupg_key_new (GPtrArray *dataset)
+_gcr_gnupg_key_new (GPtrArray *pubset, GPtrArray *secset)
 {
-	g_return_val_if_fail (dataset, NULL);
-	return g_object_new (GCR_TYPE_GNUPG_KEY, "dataset", dataset, NULL);
+	g_return_val_if_fail (pubset, NULL);
+	return g_object_new (GCR_TYPE_GNUPG_KEY,
+	                     "public-dataset", pubset,
+	                     "secret-dataset", secset,
+	                     NULL);
 }
 
 /**
- * _gcr_gnupg_key_get_dataset:
+ * _gcr_gnupg_key_get_public_dataset:
  * @self: The key
  *
  * Get the colons data this key is based on.
@@ -209,38 +228,108 @@ _gcr_gnupg_key_new (GPtrArray *dataset)
  * Returns: An array of GcrColons*, owned by the key.
  */
 GPtrArray*
-_gcr_gnupg_key_get_dataset (GcrGnupgKey *self)
+_gcr_gnupg_key_get_public_dataset (GcrGnupgKey *self)
 {
 	g_return_val_if_fail (GCR_IS_GNUPG_KEY (self), NULL);
-	return self->pv->dataset;
+	return self->pv->public_dataset;
 }
 
 /**
- * _gcr_gnupg_key_set_dataset:
+ * _gcr_gnupg_key_set_public_dataset:
  * @self: The key
  * @dataset: The new array of GcrColons*
  *
  * Change the colons data that this key is based on.
  */
 void
-_gcr_gnupg_key_set_dataset (GcrGnupgKey *self, GPtrArray *dataset)
+_gcr_gnupg_key_set_public_dataset (GcrGnupgKey *self, GPtrArray *dataset)
 {
 	GObject *obj;
+	const gchar *old_keyid;
+	const gchar *new_keyid;
 
 	g_return_if_fail (GCR_IS_GNUPG_KEY (self));
 	g_return_if_fail (dataset);
 
+	/* Check that it matches previous */
+	if (self->pv->public_dataset) {
+		old_keyid = _gcr_gnupg_key_get_keyid_for_colons (self->pv->public_dataset);
+		new_keyid = _gcr_gnupg_key_get_keyid_for_colons (dataset);
+
+		if (g_strcmp0 (old_keyid, new_keyid) != 0) {
+			g_warning ("it is an error to change a gnupg key so that the "
+			           "fingerprint is no longer the same: %s != %s",
+			           old_keyid, new_keyid);
+			return;
+		}
+	}
+
 	g_ptr_array_ref (dataset);
-	if (self->pv->dataset)
-		g_ptr_array_unref (self->pv->dataset);
-	self->pv->dataset = dataset;
+	if (self->pv->public_dataset)
+		g_ptr_array_unref (self->pv->public_dataset);
+	self->pv->public_dataset = dataset;
 
 	obj = G_OBJECT (self);
 	g_object_freeze_notify (obj);
-	g_object_notify (obj, "dataset");
+	g_object_notify (obj, "public-dataset");
 	g_object_notify (obj, "label");
 	g_object_notify (obj, "markup");
-	g_object_notify (obj, "keyid");
+	g_object_thaw_notify (obj);
+}
+
+/**
+ * _gcr_gnupg_key_get_secret_dataset:
+ * @self: The key
+ *
+ * Get the colons secret data this key is based on. %NULL if a public key.
+ *
+ * Returns: An array of GcrColons*, owned by the key.
+ */
+GPtrArray*
+_gcr_gnupg_key_get_secret_dataset (GcrGnupgKey *self)
+{
+	g_return_val_if_fail (GCR_IS_GNUPG_KEY (self), NULL);
+	return self->pv->secret_dataset;
+}
+
+/**
+ * _gcr_gnupg_key_set_secret_dataset:
+ * @self: The key
+ * @dataset: The new array of GcrColons*
+ *
+ * Set the secret data for this key. %NULL if public key.
+ */
+void
+_gcr_gnupg_key_set_secret_dataset (GcrGnupgKey *self, GPtrArray *dataset)
+{
+	GObject *obj;
+	const gchar *pub_keyid;
+	const gchar *sec_keyid;
+
+	g_return_if_fail (GCR_IS_GNUPG_KEY (self));
+
+	/* Check that it matches public key */
+	if (self->pv->public_dataset && dataset) {
+		pub_keyid = _gcr_gnupg_key_get_keyid_for_colons (self->pv->public_dataset);
+		sec_keyid = _gcr_gnupg_key_get_keyid_for_colons (dataset);
+
+		if (g_strcmp0 (pub_keyid, sec_keyid) != 0) {
+			g_warning ("it is an error to create a gnupg key so that the "
+			           "fingerprint of thet pub and sec parts are not the same: %s != %s",
+			           pub_keyid, sec_keyid);
+			return;
+		}
+	}
+
+	if (dataset)
+		g_ptr_array_ref (dataset);
+	if (self->pv->secret_dataset)
+		g_ptr_array_unref (self->pv->secret_dataset);
+	self->pv->secret_dataset = dataset;
+
+	obj = G_OBJECT (self);
+	g_object_freeze_notify (obj);
+	g_object_notify (obj, "secret-dataset");
 	g_object_thaw_notify (obj);
 }
 
@@ -258,10 +347,12 @@ _gcr_gnupg_key_get_keyid_for_colons (GPtrArray *dataset)
 	GcrColons *colons;
 
 	colons = _gcr_colons_find (dataset, GCR_COLONS_SCHEMA_PUB);
-	if (colons == NULL)
-		return NULL;
-
-	return _gcr_colons_get_raw (colons, GCR_COLONS_PUB_KEYID);
+	if (colons != NULL)
+		return _gcr_colons_get_raw (colons, GCR_COLONS_PUB_KEYID);
+	colons = _gcr_colons_find (dataset, GCR_COLONS_SCHEMA_SEC);
+	if (colons != NULL)
+		return _gcr_colons_get_raw (colons, GCR_COLONS_SEC_KEYID);
+	return NULL;
 }
 
 /**
diff --git a/gcr/gcr-gnupg-key.h b/gcr/gcr-gnupg-key.h
index b1b8765..e6d0235 100644
--- a/gcr/gcr-gnupg-key.h
+++ b/gcr/gcr-gnupg-key.h
@@ -61,11 +61,17 @@ GType               _gcr_gnupg_key_get_type                      (void);
 
 const GcrColumn*    _gcr_gnupg_key_get_columns                   (void);
 
-GcrGnupgKey*        _gcr_gnupg_key_new                           (GPtrArray *dataset);
+GcrGnupgKey*        _gcr_gnupg_key_new                           (GPtrArray *pubset,
+                                                                  GPtrArray *secset);
 
-GPtrArray*          _gcr_gnupg_key_get_dataset                   (GcrGnupgKey *self);
+GPtrArray*          _gcr_gnupg_key_get_public_dataset            (GcrGnupgKey *self);
 
-void                _gcr_gnupg_key_set_dataset                   (GcrGnupgKey *self,
+void                _gcr_gnupg_key_set_public_dataset            (GcrGnupgKey *self,
+                                                                  GPtrArray *dataset);
+
+GPtrArray*          _gcr_gnupg_key_get_secret_dataset            (GcrGnupgKey *self);
+
+void                _gcr_gnupg_key_set_secret_dataset            (GcrGnupgKey *self,
                                                                   GPtrArray *dataset);
 
 const gchar*        _gcr_gnupg_key_get_keyid_for_colons          (GPtrArray *dataset);
diff --git a/gcr/tests/test-gnupg-key.c b/gcr/tests/test-gnupg-key.c
index 5f1efac..dfb19a3 100644
--- a/gcr/tests/test-gnupg-key.c
+++ b/gcr/tests/test-gnupg-key.c
@@ -34,6 +34,8 @@
 
 typedef struct {
 	GPtrArray *dataset;
+	GPtrArray *pubset;
+	GPtrArray *secset;
 	GcrGnupgKey *key;
 } Test;
 
@@ -51,9 +53,23 @@ setup (Test *test, gconstpointer unused)
 	g_ptr_array_add (dataset, _gcr_colons_parse ("fpr:::::::::CF8BCC4B18DE08FCD8A1615906AD222CADF6A6E1:\n", -1));
 	g_ptr_array_add (dataset, _gcr_colons_parse ("sub:r:1536:20:5CE086B5B5A18FF4:899817788:1025961788:::::esc:\n", -1));
 	g_ptr_array_add (dataset, _gcr_colons_parse ("fpr:::::::::AB059359A3B81F410FCFF97F5CE086B5B5A18FF4:", -1));
-
-	test->key = _gcr_gnupg_key_new (dataset);
 	test->dataset = dataset;
+
+	test->key = _gcr_gnupg_key_new (dataset, NULL);
+
+	dataset = g_ptr_array_new_with_free_func (_gcr_colons_free);
+	g_ptr_array_add (dataset, _gcr_colons_parse ("pub:u:2048:1:4842D952AFC000FD:1305189489:::u:::scESC:", -1));
+	g_ptr_array_add (dataset, _gcr_colons_parse ("uid:u::::1305189849::D0A8FA7B15DC4BE3F8F03A49C372F2718C78AFC0::Dr. Strangelove <lovingbomb@example.com>:", -1));
+	g_ptr_array_add (dataset, _gcr_colons_parse ("uid:u::::1305189489::D449F1605254754B0BBFA424FC34E50609103BBB::Test Number 1 (unlimited) <test-number-1@example.com>:", -1));
+	g_ptr_array_add (dataset, _gcr_colons_parse ("sub:u:2048:1:4852132BBED15014:1305189489::::::e:", -1));
+	test->pubset = dataset;
+
+	dataset = g_ptr_array_new_with_free_func (_gcr_colons_free);
+	g_ptr_array_add (dataset, _gcr_colons_parse ("sec::2048:1:4842D952AFC000FD:1305189489::::::::::", -1));
+	g_ptr_array_add (dataset, _gcr_colons_parse ("uid:::::::D449F1605254754B0BBFA424FC34E50609103BBB::Test Number 1 (unlimited) <test-number-1@example.com>:", -1));
+	g_ptr_array_add (dataset, _gcr_colons_parse ("uid:::::::D0A8FA7B15DC4BE3F8F03A49C372F2718C78AFC0::Dr. Strangelove <lovingbomb@example.com>:", -1));
+	g_ptr_array_add (dataset, _gcr_colons_parse ("ssb::2048:1:4852132BBED15014:1305189489::::::::::", -1));
+	test->secset = dataset;
 }
 
 static void
@@ -61,6 +77,8 @@ teardown (Test *test, gconstpointer unused)
 {
 	g_object_unref (test->key);
 	g_ptr_array_unref (test->dataset);
+	g_ptr_array_unref (test->pubset);
+	g_ptr_array_unref (test->secset);
 }
 
 static void
@@ -101,13 +119,27 @@ test_dataset (Test *test, gconstpointer unused)
 {
 	GPtrArray *dataset;
 
-	g_object_get (test->key, "dataset", &dataset, NULL);
+	g_object_get (test->key, "public-dataset", &dataset, NULL);
 	g_assert (dataset == test->dataset);
 
+	_gcr_gnupg_key_set_public_dataset (test->key, dataset);
+	g_assert (dataset == _gcr_gnupg_key_get_public_dataset (test->key));
+
 	g_ptr_array_unref (dataset);
 }
 
 static void
+test_keyid (Test *test, gconstpointer unused)
+{
+	gchar *keyid;
+
+	g_object_get (test->key, "keyid", &keyid, NULL);
+	g_assert_cmpstr (keyid, ==, "621CC013");
+
+	g_free (keyid);
+}
+
+static void
 test_keyid_for_colons (Test *test, gconstpointer unused)
 {
 	const gchar *keyid;
@@ -116,6 +148,22 @@ test_keyid_for_colons (Test *test, gconstpointer unused)
 	g_assert_cmpstr (keyid, ==, "6C7EE1B8621CC013");
 }
 
+static void
+test_with_secret (Test *test, gconstpointer unused)
+{
+	GcrGnupgKey *key;
+	GPtrArray *secset;
+
+	key = _gcr_gnupg_key_new (test->pubset, test->secset);
+	g_assert (GCR_IS_GNUPG_KEY (key));
+
+	g_object_get (key, "secret-dataset", &secset, NULL);
+	g_assert (secset == _gcr_gnupg_key_get_secret_dataset (key));
+	g_object_set (key, "secret-dataset", secset, NULL);
+
+	g_object_unref (key);
+}
+
 int
 main (int argc, char **argv)
 {
@@ -126,7 +174,9 @@ main (int argc, char **argv)
 	g_test_add ("/gcr/gnupg-key/description", Test, NULL, setup, test_description, teardown);
 	g_test_add ("/gcr/gnupg-key/markup", Test, NULL, setup, test_markup, teardown);
 	g_test_add ("/gcr/gnupg-key/dataset", Test, NULL, setup, test_dataset, teardown);
+	g_test_add ("/gcr/gnupg-key/keyid", Test, NULL, setup, test_keyid, teardown);
 	g_test_add ("/gcr/gnupg-key/keyid_for_colons", Test, NULL, setup, test_keyid_for_colons, teardown);
+	g_test_add ("/gcr/gnupg-key/with_secret", Test, NULL, setup, test_with_secret, teardown);
 
 	return g_test_run ();
 }
diff --git a/testing/gnupg-example/pubring.gpg b/testing/gnupg-example/pubring.gpg
new file mode 100644
index 0000000..10b1372
Binary files /dev/null and b/testing/gnupg-example/pubring.gpg differ
diff --git a/testing/gnupg-example/random_seed b/testing/gnupg-example/random_seed
new file mode 100644
index 0000000..94b1acf
Binary files /dev/null and b/testing/gnupg-example/random_seed differ
diff --git a/testing/gnupg-example/secring.gpg b/testing/gnupg-example/secring.gpg
new file mode 100644
index 0000000..4a21e26
Binary files /dev/null and b/testing/gnupg-example/secring.gpg differ
diff --git a/testing/gnupg-example/trustdb.gpg b/testing/gnupg-example/trustdb.gpg
new file mode 100644
index 0000000..c0ba085
Binary files /dev/null and b/testing/gnupg-example/trustdb.gpg differ
