Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for exporting private key data #30

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

arik-so
Copy link

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

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
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
Copy link
Author

arik-so commented Dec 28, 2015

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
Copy link
Author

arik-so commented Dec 28, 2015

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
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
Owner

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

@arik-so
Copy link
Author

arik-so commented Feb 10, 2016

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