Is there a common best practice for naming exported public and private GPG keys when exporting them or otherwise storing them as files?
I know that GnuPG doesn’t care what keys are named when you import them. However, there must be some naming conventions for exporting. There always is for this sort of thing. I just can’t find a clear answer myself here or through Google.
I imagine there might not be a common best practice for naming private keys. In server environments, the private key seldom gets exported. But for personal communication encryption, a private key needs to be backed up, and possibly imported on a new computer. Therefore, it must be exported. In theory, you are the only person who will ever see the private key file and know what it is, so there is no need for a “best practice” naming convention. But the public key file must be shared and so there ought to be some common best practice out there.
Suppose I just created a new key pair: Bruce Wayne <firstname.lastname@example.org>.
Then I export the private and public keys as ASCII-armored files—the private key to be stored somewhere secure for backup and the public key to be shared with people.
What should I name the files? What extension should I use?
Using the UID “Real Name”…
Using the UID email address…
When keys are generated, there’s an eight (hex) character ID that’s displayed. I have seen a public key use this as the filename.
~ # gpg --list-keys /root/.gnupg/pubring.kbx ------------------------ pub rsa2048/1234ABCD 2016-08-20 [SC] uid [ultimate] Bruce Wayne <email@example.com> sub rsa2048/5678EABC 2016-08-20 [E]
If there is any common best practice, please let me know. And, if possible, point me to any documentation or manual that uses it.