-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Make copying private key easier #1447
Comments
I hoped the standard keychain functionality would be enough, but apparently not. Ability to import a key from command-line sounds like a good idea. Could you make a PR for it? |
This speculation of mine was wrong. It is true, I couldn't set kSecAttrProtocol. But kSecAttrProtocol is meaningless/ignored on generic passwords like the one Sparkle uses to store the ed25519 private key. See #1448. |
The reason this failed is Keychain Access, AFAICT, cannot create generic passwords, only Internet paswords. |
Indeed the following command can be used to generate a keychain entry that closely matches what security add-generic-password \
-a ed25519 \
-s https://sparkle-project.org \
-T /abs/path/to/Sparkle/bin/generate_appcast \
-w e.g. security add-generic-password \
-a ed25519 \
-s https://sparkle-project.org \
-T /Applications/Sparkle-1.21.3/bin/generate_appcast \
-w (This command will prompt you for the "password" (private key) and will prompt you to confirm it.) (I didn't bother to make the command match what So, though it might be nice to have |
@bdenckla-ua thanks for your example. It works :) |
An option to export/import keys in generate_keys was added on top of master / 2.x (#1730) |
sign_update was also updated to take a signing key as argument or from a file. I assume this is resolved now. |
Right now AFAICT there is no easy way to copy the ed25519 private key from one machine to another!
(I'm assuming the recommended workflow where the key stored as a "generic password" in Keychain Access. As distinct from an "Internet password" or a "key", for instance.)
Maybe I'm missing something, as this seems like a major problem for many uses cases such as:
I.e. AFAICT neither the generic features provided by Apple's Keychain Access, nor specific features provided by Sparkle make such key copies easy.
(Perhaps the generic features to export & import an entire keychain could be used? But that would seem to import a lot of undesired data, unless somehow the import could be filtered down to a single "password".)
Not only are key copies not easy, in fact I haven't really yet found a feasible way in which such a copy is even possible!
For example, attempting to manually create a copy of the key ("password") on another machine using Keychain Access seems to fail, perhaps because I can't set kSecAttrProtocol to kSecAttrProtocolSSH using the Keychain Access GUI.
Perhaps
generate_keys
could be extended to optionally accept a private key on the command line, allowing it to generate a copy instead of a new, unique key? Perhaps in that case it should require the public key, too, so it can generate the proper/expected comment in the "password" entry.Or perhaps somehow
/usr/bin/security
can be used to generate a copy including the proper kSecAttrProtocol attribute?The text was updated successfully, but these errors were encountered: