static void print_keyset (CryptUIKeyset *keyset) { GList *keys, *l; gboolean cache = FALSE; gchar *name; guint flags; keys = cryptui_keyset_get_keys (keyset); for(l = keys; l; l = g_list_next (l)) { g_print ("key: %s\n", (gchar*)l->data); /* Test half of them cached, half not */ if (cache) cryptui_keyset_cache_key (keyset, (gchar*)l->data); cache = !cache; name = cryptui_keyset_key_display_name (keyset, (gchar*)l->data); g_print (" name: %s\n", name); g_free (name); name = cryptui_keyset_key_display_id (keyset, (gchar*)l->data); g_print (" id: %s\n", name); g_free (name); flags = cryptui_keyset_key_flags (keyset, (gchar*)l->data); g_print (" flags: %d\n", flags); } }
static gboolean signer_filter (CryptUIKeyset *ckset, const gchar *key, gpointer user_data) { guint flags = cryptui_keyset_key_flags (ckset, key); return flags & CRYPTUI_FLAG_CAN_SIGN; }