Heimdall icon indicating copy to clipboard operation
Heimdall copied to clipboard

Added support for exporting private key data

Open arik-so opened this issue 10 years ago • 6 comments

Occasionally, the private key needs to be exported, e. g. if the user needs to transfer their data to another device or wants to create a backup. Allowing developers to have this functionality doesn't hurt.

arik-so avatar Dec 25 '15 22:12 arik-so

It may make sense to also implement a function that exports the private key data in a more standard format, similar to how the public key data is exportable as X.509. Perhaps for private key, it should be something like a PEM format (in essence a container around the key) that only includes the private key?

Once the private key getter is made public, it may also make sense to expose a function for obtaining the complete pair (where applicable) as a single data blob (again, PEM for example)

henrinormak avatar Dec 26 '15 08:12 henrinormak

I agree. I'm currently trying to figure out how to convert the data to PEM format. The data appears to be much shorter than what the base64 part in a PEM usually takes up.

arik-so avatar Dec 28 '15 18:12 arik-so

I found this relevant question on Stackoverflow, but I'm stuck in the same position. http://stackoverflow.com/questions/32955716/generating-a-pkcs12-key-from-seckeyref-on-ios

arik-so avatar Dec 28 '15 19:12 arik-so

I can investigate this as well in the near future (hopefully), however, for the time being it might be worth looking into how the public key X.509 export/import works, seeing as a PEM file contains something similar. In terms of exporting the data, make sure that you have a private key to export.

henrinormak avatar Dec 29 '15 20:12 henrinormak

Any update on this? Unfortunately, I haven't found the time to investigate this myself.

henrinormak avatar Feb 03 '16 18:02 henrinormak

Hey @henrinormak, alas, nor have I. When I was working on it I was trying to look up the intricacies of the private key format, but never got around to implementing it.

arik-so avatar Feb 10 '16 00:02 arik-so