0

Let's say I create a file with C-xC-f file.gpg, then save it with C-xC-s. I get to this buffer:

Select recipients for encryption.
If no one is selected, symmetric encryption will be performed.  
- `M-x epa-mark-key' to mark a key on the line
- `M-x epa-unmark-key' to unmark a key on the line
[Cancel][OK]

  u 372XXXXX Jane Doe <jane@doe.com>
  u A4DXXXXX John Doe <john@doe.com>

and I mark 372XXXXX as the recipient. Now I have a file.gpg that's decryptable by 372XXXXX's private key.

After a time I decide I want to add A4DXXXXX to the recipients, so that it's decryptable by 372XXXXX and A4DXXXXX.

Is there any sane option except copy-pasting the full contents, creating a new file and then marking the keys anew? I found epa-file-select-keys but that apparently only opens the selection buffer without doing any actual change to the file, so when I clear the GPG cache and reload file with C-xC-v I only get prompted for the first marked key (372XXXXX).

When I mark 2+ keys (372XXXXX + A4DXXXXX) in the beginning (from scratch when creating the file, no re-encryption), it'll ask for 2+ marked keys just fine.

Peter Badida
  • 101
  • 3

1 Answers1

0

Actually, it seems to work, but in a bit strange way.

If I don't have the key's password cached yet, I'll get prompted automatically with epa-file-select-keys dialog even after saving file multiple times -- which is one way of making it work.

After the password is cached, epa-file-select-keys doesn't prompt anymore. It still is the go to func though.

Now when I want to add a new recipient/key, epa-file-select-keys is only a variable changing function via setq-local and requires manual saving yet again even though the buffer is marked as unchanged, therefore a C-xC-s does nothing and outputs only (No changes need to be saved).

Therefore at least one change is necessary, for which I simply either add+remove a space or a new line.

Although this seems like the epa-file-select-keys's fault, most likely it's not messing with the buffer's state directly so that it's usable in custom code (which marking a buffer as changed would make harder).

Peter Badida
  • 101
  • 3