I want to tell epa to encrypt for two of my public keys. (stored in two different places). I have this at the top of the file:

# -*- mode:org; epa-file-encrypt-to: ("arthur@ul___dt.com") -*-

which causes it to select the first one key for that email. If i run epa-file-select-keys I can choose the two keys I want, though only for that session. I would prefer it remember this decision in the file so I don't have to remember to do this each time on each new computer this file is opened on.

  1. How can I specify two keys by key-id on that line?
  2. What is the actual syntax of the strings in the epa-file-encrypt-to variable? Is it defined somewhere? How are specific keys selected from this string

PS: these keys have the same user-id string and I'd prefer not to have to change that.

PPS: there is also a revoked key with the same email that it needs to not choose. I have tried on emacs 24.3.1 and emacs 25-snapshot

# -*- mode:org; epa-file-encrypt-to: ("arthur@ul___dt.com", "foo@bar.baz") -*-

When a mail address is associated to several keys switch to the key ids. E.g. a call to epa-file-select-keys reveals key ids. The header line with fake key ids looks like:

# -*- mode:org; epa-file-encrypt-to: ("12345678ABCDEF00", "12345678ABCDEF01") -*-

I have not found a syntax-definition for variable epa-file-encrypt-to. I guess it's supposed to be a list containing identifiers for keys as they can be understood by the gpg program.

| improve this answer | |
  • and it also works if you mix email addressed and the long ids – Arthur Ulfeldt Jul 18 '15 at 1:44
  • I had tried this using the short id's before asking, and though it didn't work – Arthur Ulfeldt Jul 20 '15 at 7:45

for me leaving the comma away work. Looks like this:

# -*- mode:org; epa-file-encrypt-to: ("arthur@ul___dt.com" "foo@bar.baz") -*-
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.