Okular: OpenPGP certificate export should create the same files as with Kleopatra
Closed, ResolvedPublic

Assigned To
Authored By
ebo
Fri, Jun 12, 2:56 PM

Description

related to T8291

When exporting a certificate via Okular's certificate viewer, it currently creates a file with the ending ".cer" and always opens the directory C:\Windows\System32 for saving, even if it was exported once before to the users Document folder:

The content is binary. The file can be imported without issues but ".cer" is used for S/MIME and we should offer either ".gpg" or better the default export format for Kleopatra, ".asc".

Let's use the same naming convention as Kleopatra does:

NAME_0xKey-ID_public.asc

Details

Version
4win 5.0.2

Event Timeline

ebo mentioned this in Unknown Object (Maniphest Task).Mon, Jun 15, 10:24 AM
ebo triaged this task as Normal priority.Fri, Jun 19, 1:42 PM
ebo moved this task from Backlog to WIP on the gpd5x board.
svuorela mentioned this in Unknown Object (Maniphest Task).Mon, Jun 22, 6:12 AM
ebo changed the task status from Open to Testing.Wed, Jun 24, 4:10 PM

was merged in okular on 2026-06-21

timegrid changed the task status from Testing to Open.Wed, Jul 8, 3:58 PM
timegrid moved this task from QA to WIP on the gpd5x board.
timegrid added a subscriber: timegrid.

Issues found:

  • Name is <FPR>_public.asc now, not <NAME>_0x<KEYID>_public.asc
  • The suggested folder is now the folder of the opened file, which is definitely better than the windows system dir. @ebo are you fine with that?

yes, the folder is OK.

Regarding the name: as time is currently short, we could make a new ticket for the name change, if at least the content of the export is the same one as the export by Kleopatra.
The current name is unique and one immediately sees that it is supposed to be an public key.

In T8293#220040, @ebo wrote:

if at least the content of the export is the same

Good point, I forgot to check the content.

Issues found

  • The content is still binary

by KEYID, do you mean the short keyid? Okular doesn't actually know about that and there is no easy way to get there.

Yes, that one:

  • Fingerprint: 98111E67AE06F2BEFD2BDE10C5D6C919005F36A4
  • Keyid: C5D6C919005F36A4

Should be the last 16 chars of the fingerprint (but the first 16 chars of kyber keys).
If that's too complicated, I'd also be fine with the <NAME>_<FPR>_public.asc, if the content is ascii armored.

name contains spaces. How to mangle those ?

underscores usual I'd say. There is no semantic in the format of the file name.

Well, Kleopatra keeps the whitespaces in names. If you handle them differently it will again deviate from what Kleo does.

In T8293#220072, @ebo wrote:

Well, Kleopatra keeps the whitespaces in names. If you handle them differently it will again deviate from what Kleo does.

Please use underscores, this was changed in Kleopatra: T7848: Kleopatra: Remove whitespace from suggested export filename
See also the screenshot (right one is Kleopatra):

Seems I am behind the times ;-)

it will be Sune_Vuorela_FPR_public.asc hopefully soon. and hopefully ascii armored.
I don't have the key-id handy, only the full fingerprint, and I'm not sure we should be playing scrabble with the keyId in Okular code. I'll see if I at some point can get the keyid thru.

svuorela changed the task status from Open to Testing.Fri, Jul 10, 11:32 AM
timegrid claimed this task.

Looks good to me on gpg4win-5.1.0-beta658 @ win11: