xca icon indicating copy to clipboard operation
xca copied to clipboard

Exporting private keys with MacOS doesn't work

Open miriamstreit opened this issue 4 months ago • 9 comments

My MacOS version is Sonoma 14.2.1 and I'm using the xca version 2.5.0.

Currently none of the following ways to export a private key have worked for me:

  • Exporting the private key directly under the tab "private keys" -> export: This will create an empty file, no matter which format I use.
  • Exporting the private key under the tab "certificates" -> export -> export format "PEM + key": This will create a file containing the certificate but there is no key.

I am happy to provide a logfile if someone could point me to where it is located under MacOS.

miriamstreit avatar Feb 23 '24 13:02 miriamstreit

Issues #465 and #497 describe the "PEM +Key" issue, which is fixed in the upcoming release. You may try this latest action build Exporting the private key directly from the private keys tab always worked. (Tested once more right now with 2.5.0 on Sonoma 14.2.1)

You are using the AppStore version or the DMG?

After setting the "Clipboard format" to PEM-private you could drag a key from XCA into the Finder to export it.

chris2511 avatar Feb 23 '24 13:02 chris2511

Hi Chris, any ETA for the upcoming release?

GiladHi avatar Feb 26 '24 16:02 GiladHi

Hi Chris, any ETA for the upcoming release?

Very soon. This week if time permits.

chris2511 avatar Feb 26 '24 18:02 chris2511

It is impossible for me to export the private key directly from my private key tab. My colleague is having exactly the same issues as me, he's also on Sonoma 14.2.1.

I downloaded the DMG from the website and installed it this way.

Could you please tell me how I can change the clipboard format? I was unable to find a setting like this. I tried the drag-and-drop approach without it which made xca crash. But I assume this is an expected behaviour if the setting is wrong.

Thank you so much!

miriamstreit avatar Feb 27 '24 10:02 miriamstreit

Could you please tell me how I can change the clipboard format?

In the context menu of the "Private Keys" Tab: "Clipboard format" can be changed for all keys in this database.

I tried the drag-and-drop approach without it which made xca crash.

This is fixed with xca-2.6.0, released yesterday and will export the public key only by default.

chris2511 avatar Feb 27 '24 12:02 chris2511

Thank you! I found out that the format has already been set to "PEM Private". However, when I try to copy the key to my clipboard, xca still crashes. If I understood correctly, this functionality is working for you? There might be an issue with my installation or my database in this case. Where can I find the log file so we can troubleshoot this?

I have now installed the new version and tested all of the cases again:

  • Drag-and-drop private key: xca freezes and does not respond anymore
  • Copy private key to clipboard: xca freezes and does not respond anymore
  • Export from side-menu in the tab private keys: still creates an empty file
  • Export with certificate: now also creates an empty file, not even the certificate is there

xca 2.6.0 also crashes a lot more often than it did with the version 2.5.0. I had to force quit and restart it after every attempt because it just froze after I did something.

miriamstreit avatar Feb 27 '24 15:02 miriamstreit

Sounds very mysterious .... What CPU do you have? On my M2 I cannot reproduce any of the reported crashes.

chris2511 avatar Feb 27 '24 20:02 chris2511

I also have an M2 processor. It seems weird indeed.

I could also try some other ways of installation like Homebrew or the AppStore. Or do you think that doesn't matter? I'm asking because earlier you asked me how I installed xca.

I asked my colleague to test these cases as well and for him xca 2.6.0 is installed in a language he doesn't understand. My previous installation was in English, my 2.6.0 installation is in German (which I don't mind as this is my native language). However there was no way to decide which language I want to install. This would probably go into another ticket as it is unrelated but I just wanted to let you know! ETA: I just noticed this ticket for the language issues: https://github.com/chris2511/xca/issues/532. I guess my colleague will try to reproduce my issues once he fixed the language on his installation :)

miriamstreit avatar Feb 28 '24 09:02 miriamstreit

I have the same database as @miriamstreit and tried to export private keys as well:

  • Drag-and-drop private key: Works for me on SOME keys. The only difference I see is the "source" of the key. It seems that "Generated" keys are working with this approach - "Imported" ones are not.
  • Copy private key to clipboard: xca freezes and does not respond anymore (Application not responding) and has to be forced quit
  • Export from side-menu in the tab private keys: xca freezes and does not respond anymore (Application not responding) and has to be forced quit - creates a zero byte file.
  • Export with certificate in the side-menu in the certificate tab (PEM + key option): xca freezes and does not respond anymore (Application not responding) and has to be forced quit - creates a zero byte file.

I'm working on an "M2 Pro" MacBook Pro with Sonama 14.3.1

EDIT: Installed xca 2.6.0 with brew

rumpli avatar Feb 28 '24 09:02 rumpli