Skip to content

Added support for exporting private key data - #30

Open
arik-so wants to merge 1 commit into
henrinormak:masterfrom
arik-so:master
Open

Added support for exporting private key data#30
arik-so wants to merge 1 commit into
henrinormak:masterfrom
arik-so:master

Conversation

@arik-so

@arik-so arik-so commented Dec 25, 2015

Copy link
Copy Markdown

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.

@henrinormak

Copy link
Copy Markdown
Owner

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)

@arik-so

arik-so commented Dec 28, 2015

Copy link
Copy Markdown
Author

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

arik-so commented Dec 28, 2015

Copy link
Copy Markdown
Author

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

@henrinormak

Copy link
Copy Markdown
Owner

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

Copy link
Copy Markdown
Owner

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

@arik-so

arik-so commented Feb 10, 2016

Copy link
Copy Markdown
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants