Ejemplo n.º 1
0
static void
realize_signatures (SeahorseGpgmeUid *self)
{
	gpgme_key_sig_t gsig;
	SeahorsePgpSignature *sig;
	GList *sigs = NULL;
	guint flags;
	
	g_return_if_fail (self->pv->pubkey);
	g_return_if_fail (self->pv->userid);
	
	/* If this key was loaded without signatures, then leave them as is */
	if ((self->pv->pubkey->keylist_mode & GPGME_KEYLIST_MODE_SIGS) == 0) 
		return;
	
	for (gsig = self->pv->userid->signatures; gsig; gsig = gsig->next) {
		sig = seahorse_pgp_signature_new (gsig->keyid);
		
		/* Order of parsing these flags is important */
		flags = 0;
		if (gsig->revoked)
			flags |= SEAHORSE_FLAG_REVOKED;
		if (gsig->expired)
			flags |= SEAHORSE_FLAG_EXPIRED;
		if (flags == 0 && !gsig->invalid)
			flags = SEAHORSE_FLAG_IS_VALID;
		if (gsig->exportable)
			flags |= SEAHORSE_FLAG_EXPORTABLE;
	
		seahorse_pgp_signature_set_flags (sig, flags);
		sigs = g_list_prepend (sigs, sig);
	}
	
	seahorse_pgp_uid_set_signatures (SEAHORSE_PGP_UID (self), sigs);
	seahorse_object_list_free (sigs);
}
Ejemplo n.º 2
0
static void
seahorse_pgp_uid_set_property (GObject *object, guint prop_id, const GValue *value, 
                               GParamSpec *pspec)
{
	SeahorsePgpUid *self = SEAHORSE_PGP_UID (object);

	switch (prop_id) {
	case PROP_SIGNATURES:
		seahorse_pgp_uid_set_signatures (self, g_value_get_boxed (value));
		break;
	case PROP_VALIDITY:
		seahorse_pgp_uid_set_validity (self, g_value_get_uint (value));
		break;
	case PROP_NAME:
		seahorse_pgp_uid_set_name (self, g_value_get_string (value));
		break;
	case PROP_EMAIL:
		seahorse_pgp_uid_set_email (self, g_value_get_string (value));
		break;
	case PROP_COMMENT:
		seahorse_pgp_uid_set_comment (self, g_value_get_string (value));
		break;
	}
}