Closed ChristopherA closed 5 months ago
So this will not work properly if you have more than one (ssh key).
Why do you say that? The -R
flag accepts a list of recipients, and any of the corresponding private keys can be used to decrypt. Which seems like excellent default behavior.
SSH key support is a convenience feature, not the "proper" way to use age. Most GitHub accounts have auth SSH keys but not signing SSH keys, so supporting the latter would make little sense. We know we are taking a license on the intended purpose of the keys.
From the README
As a convenience feature, age also supports encrypting to ssh-rsa and ssh-ed25519 SSH public keys [...]
Keep in mind that people might not protect SSH keys long-term, since they are revokable when used only for authentication [...]
Environment
What were you trying to do
Get SSH keys from GitHub to use with
age
.What happened
Your home page at https://github.com/FiloSottile/age#encrypting-to-a-github-user suggests:
However, the key at GitHub.com/username.keys is a list auth keys (in my case, for instance, it is a different auth keys for each of my development computers). So this will not work properly if you have more than one.
Separately, SSH best practices is to keep auth keys separate from signing keys, so GitHub now supports the ability to keep those keys separate and makes them publicly available
https://api.github.com/users/<username>/ssh_signing_keys
, however, it is not well documented, and it is in a JSON array rather than a list. But it is useful.See also: https://github.com/github/docs/issues/28577#issuecomment-1876135675 & https://github.com/dolmen/github-keygen/issues/54#issuecomment-1875907350
p.s. One of my goals this year is to write up some improved best practices for creation and protection of SSH keys, and their use in GitHub and for file signing. I'll have a zsh script that should be easily adaptable for use with
age
.