예제 #1
0
void
seahorse_pgp_signature_set_flags (SeahorsePgpSignature *self, guint flags)
{
	GObject *obj;
	
	g_return_if_fail (SEAHORSE_IS_PGP_SIGNATURE (self));
	self->pv->flags = flags;

	obj = G_OBJECT (self);
	g_object_freeze_notify (obj);
	g_object_notify (obj, "flags");
	g_object_notify (obj, "sigtype");
	g_object_thaw_notify (obj);
}
예제 #2
0
void
seahorse_pgp_signature_set_keyid (SeahorsePgpSignature *self, const gchar *keyid)
{
	GObject *obj;
	
	g_return_if_fail (SEAHORSE_IS_PGP_SIGNATURE (self));
	g_free (self->pv->keyid);
	self->pv->keyid = g_strdup (keyid);
	
	obj = G_OBJECT (self);
	g_object_freeze_notify (obj);
	g_object_notify (obj, "keyid");
	g_object_notify (obj, "sigtype");
	g_object_thaw_notify (obj);
}
예제 #3
0
guint
seahorse_pgp_signature_get_sigtype (SeahorsePgpSignature *self)
{
	SeahorseObject *sobj;
	GQuark id;

	g_return_val_if_fail (SEAHORSE_IS_PGP_SIGNATURE (self), 0);
    
	id = seahorse_pgp_key_canonize_id (self->pv->keyid);
	sobj = seahorse_context_find_object (SCTX_APP (), id, SEAHORSE_LOCATION_LOCAL);
    
	if (sobj) {
		if (seahorse_object_get_usage (sobj) == SEAHORSE_USAGE_PRIVATE_KEY) 
			return SKEY_PGPSIG_TRUSTED | SKEY_PGPSIG_PERSONAL;
		if (seahorse_object_get_flags (sobj) & SEAHORSE_FLAG_TRUSTED)
			return SKEY_PGPSIG_TRUSTED;
	}

	return 0;
}
예제 #4
0
guint
seahorse_pgp_signature_get_sigtype (SeahorsePgpSignature *self)
{
	SeahorseGpgmeKeyring *keyring;
	SeahorseGpgmeKey *key;
	SeahorseObject *obj;

	g_return_val_if_fail (SEAHORSE_IS_PGP_SIGNATURE (self), 0);

	keyring = seahorse_pgp_backend_get_default_keyring (NULL);
	key = seahorse_gpgme_keyring_lookup (keyring, self->pv->keyid);

	if (key != NULL) {
		obj = SEAHORSE_OBJECT (key);
		if (seahorse_object_get_usage (obj) == SEAHORSE_USAGE_PRIVATE_KEY)
			return SKEY_PGPSIG_TRUSTED | SKEY_PGPSIG_PERSONAL;
		if (seahorse_object_get_flags (obj) & SEAHORSE_FLAG_TRUSTED)
			return SKEY_PGPSIG_TRUSTED;
	}

	return 0;
}
예제 #5
0
const gchar*
seahorse_pgp_signature_get_keyid (SeahorsePgpSignature *self)
{
	g_return_val_if_fail (SEAHORSE_IS_PGP_SIGNATURE (self), NULL);
	return self->pv->keyid;
}
예제 #6
0
guint
seahorse_pgp_signature_get_flags (SeahorsePgpSignature *self)
{
	g_return_val_if_fail (SEAHORSE_IS_PGP_SIGNATURE (self), 0);
	return self->pv->flags;
}