Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • 14
    Note that .asc stands for ASCII, but the output of gpg --list-secret-keys is binary. Commented Jun 2, 2020 at 15:49
  • 6
    Actually, .asc is for ASCII armored and the output is enciphered text. You can safely cat it and see for yourself. Also, like most linux files, the file extension is also arbitrary, doesn't technically have to be asc. @WeihangJian Commented Dec 4, 2020 at 14:44
  • 2
    It would be a good idea to remove the key file after it is imported and tests successfully. If the file is sitting there it could be used maliciously. Commented Dec 4, 2020 at 14:45
  • 1
    simply use -a option will export it in ASCII format, gpg -a --export-secret-keys name Commented Dec 14, 2021 at 4:22
  • Note that name can be either the 40-char keypair fingerprint or the long format keyid which is the last 16 chars of the fingerprint. Commented Dec 5, 2024 at 15:31