unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Daiki Ueno <ueno@gnu.org>
To: Drew Adams <drew.adams@oracle.com>
Cc: Matthew Leach <matthew@mattleach.net>, emacs-devel@gnu.org
Subject: Re: dired-like interface for GPG
Date: Tue, 18 Nov 2014 16:48:12 +0900	[thread overview]
Message-ID: <m3h9xxar0j.fsf-ueno@gnu.org> (raw)
In-Reply-To: <5f000d37-9eb1-4a5f-a46e-61aa806be4e8@default> (Drew Adams's message of "Mon, 17 Nov 2014 11:31:28 -0800 (PST)")

Drew Adams <drew.adams@oracle.com> writes:

>> I would soon like to embark on making a GPG interface for Emacs. It
>> will be somewhat like dired, but you use it manage GPG keys in the
>> keyring.
>
> If you do, please keep things as close as makes sense to the way
> Dired does things (e.g. actions on marked things, conventional
> key bindings and menus).  (But only where it makes sense.)

I like the idea, since `M-x epa-list-keys' is not very useful for key
management.  For what it's worth I've just added a few functions to
epg.el, for advanced key editing.  Now one can edit key attributes with:

--8<---------------cut here---------------start------------->8---
(defun disable-callback (context status string arg)
  (cond
   ((and (equal status "GET_LINE")
	 (equal string "keyedit.prompt"))
    (if (car arg)
	(process-send-string (epg-context-process context) "quit\n")
      (process-send-string (epg-context-process context) "disable\n")))
   ((equal status "GOT_IT")
    (setcar arg t))
   (t
    (message "Unhandled status: %s %s" status string))))

;; Disable a key, associated with a string "test key".
(let ((context (epg-make-context 'OpenPGP))
      (state (list nil))
      keys)
  (setq keys (epg-list-keys context "test key"))
  (if keys
      (epg-edit-key context (car keys) 'disable-callback state)))
--8<---------------cut here---------------end--------------->8---

The interface is a bit inconvenient, but consistent with the GPGME.

See more practical uses in GPA:
http://git.gnupg.org/cgi-bin/gitweb.cgi?p=gpa.git;a=blob;f=src/gpgmeedit.c;h=7ff9a05c0c5e8fbd1599313735160b8d8812f00b;hb=HEAD#l328

Regards,
--
Daiki Ueno



  reply	other threads:[~2014-11-18  7:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-17 19:24 dired-like interface for GPG Matthew Leach
2014-11-17 19:31 ` Drew Adams
2014-11-18  7:48   ` Daiki Ueno [this message]
2014-11-18 10:05 ` Rasmus
2014-11-18 14:55 ` Ted Zlatanov
2014-11-18 15:16   ` Drew Adams
2014-11-18 15:26     ` Ted Zlatanov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3h9xxar0j.fsf-ueno@gnu.org \
    --to=ueno@gnu.org \
    --cc=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    --cc=matthew@mattleach.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).