all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Daiki Ueno" <ueno@unixuser.org>
To: "Ted Zlatanov" <tzz@lifelogs.com>
Cc: emacs-devel@gnu.org
Subject: Re: EasyPG API and usage questions (was: Suggestion: epa-file-select-keys should show currently selected keys)
Date: Sat, 1 Mar 2008 09:23:02 +0900	[thread overview]
Message-ID: <54a15d860802291623m3c9844d1k80515e661f435179@mail.gmail.com> (raw)
In-Reply-To: <8663w7hg1o.fsf_-_@lifelogs.com>

2008/3/1, Ted Zlatanov <tzz@lifelogs.com>:
>  I want to replace encrypt.el with EasyPG in netrc.el (in Gnus and later
>  also in Emacs).  Can you explain how to replace this
>
>  (let ((encryption-model
>        (when (netrc-bound-and-true-p encrypt-file-alist)
>          (encrypt-find-model file))))
>
>   (if encryption-model
>       (encrypt-insert-file-contents file encryption-model)
>     (insert-file-contents file)))
>
>  with the equivalent EasyPG string-based or buffer-based functions?
>
>  It seems like (insert (epg-decrypt-string ...)) or
>  epa-file-insert-file-contents is the way to do it (probably the second
>  one), but I'd like to be sure I'm following the recommended usage.
>  Should netrc.el use the epa-* or epg-* interface?

Doesn't it work without any change?  epa-file changes
insert-file-contents behavior to decrypt *.gpg files automatically.

For example, I believe that the following code just works:

(epa-file-enable);; this may become (auto-encryption-mode t) in the future.

(setq nnimap-authinfo-file "~/.authinfo.gpg"
      nntp-authinfo-file "~/.authinfo.gpg"
      smtpmail-auth-credentials "~/.authinfo.gpg")

What feature do you want in addition to this?

>  functionality?  The epa.texi file doesn't seem to cover
>  epa-file-name-regexp for example, to explain what will happen with files
>  that match, and how to create such files with various options (see
>  below).  By the way, epa-file-name-regexp should be a list of regular
>  expressions and filenames, so the users can add something easily to the
>  list.

If all the custom-options should be documented in texi, I will do it.

>  Generally the EasyPG user documentation is very bare, so I had a hard
>  time understanding how to use it.  Is there additional documentation
>  outside of epa.texi?  Specifically, as a user I couldn't figure out how
>  to do the following from inside EasyPG:

Which are you talking about: user commands or API?

As the web-page says, EasyPG is consists of two different kinds of
components: EasyPG Assistant and EasyPG Library.  EasyPG Assistant is
an analog to GPA and EasyPG Library is an analog to GPGME.

Since IIRC Richard doesn't want API docs in texi, I only provide the
docs of EasyPG Assistant (user commands) and I think that epa.texi is
sufficient for typical users.

Anyway, a good starting point to use the EasyPG Library is the GPGME manual.

>  - how do I specify a particular cipher?

There is no such API in lisp level, since I doubt that there is any
practical use to select ciphers per data.  Is it not enough to put
cipher-algo option in ~/.gnupg/gpg.conf?

>  - how do I specify symmetric encryption?

Just pass nil as RECIPIENTS to the epg-encrypt-*.  This is documented
in their docstrings.

>  - how do I specify plaintext instead of binary output?

s/plaintext/ASCII armor/?  It can be done with:

(let ((epg-make-context 'OpenPGP))
  (epg-context-set-armor t)
  (epg-encrypt-string context "test test test" nil))

>  - how do I generate a GPG key?  (I realize GPG will do it, but epa.texi
>   just says you can import keys without explaining)

There are API functions epg-generate-key-from-*, but interactive
commands are missing.  Patches welcome.

Regards,
-- 
Daiki Ueno




  reply	other threads:[~2008-03-01  0:23 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-25 10:12 Suggestion: epa-file-select-keys should show currently selected keys Sascha Wilde
2008-02-25 19:01 ` Richard Stallman
2008-02-26  9:35   ` Sascha Wilde
2008-02-26 23:47     ` Richard Stallman
2008-02-27  8:39   ` Daiki Ueno
2008-02-27 16:08     ` Richard Stallman
2008-02-28  8:36       ` Daiki Ueno
2008-02-28 13:56     ` Bastien
2008-02-29  1:40       ` Richard Stallman
2008-02-29  4:07       ` Daiki Ueno
2008-02-29  4:59         ` Stefan Monnier
2008-02-29 16:40         ` EasyPG API and usage questions (was: Suggestion: epa-file-select-keys should show currently selected keys) Ted Zlatanov
2008-03-01  0:23           ` Daiki Ueno [this message]
2008-03-01  0:38             ` Daiki Ueno
2008-03-03 20:19             ` EasyPG API and usage questions Ted Zlatanov
2008-03-04  6:31               ` Daiki Ueno
2008-03-04 14:42                 ` Ted Zlatanov
2008-03-05  7:25                   ` Daiki Ueno
2008-03-05 16:24                     ` Ted Zlatanov
2008-03-05 16:41                     ` Ted Zlatanov
2008-03-01 10:20           ` Reiner Steib
2008-03-03 19:50             ` Ted Zlatanov
2008-02-26  9:42 ` Suggestion: epa-file-select-keys should show currently selected keys Sascha Wilde
2008-02-27  8:07   ` Daiki Ueno
2008-02-27 12:01     ` Sascha Wilde
2008-03-04 14:36       ` Sascha Wilde
2008-03-11  8:53         ` Sascha Wilde
2008-03-16  4:05           ` Michael Olson

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

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

  git send-email \
    --in-reply-to=54a15d860802291623m3c9844d1k80515e661f435179@mail.gmail.com \
    --to=ueno@unixuser.org \
    --cc=emacs-devel@gnu.org \
    --cc=tzz@lifelogs.com \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.