From what little I know, in openpgp you have a private key which you keep locked or hidden somewhere and a public key which you can freely share with anybody.
Now I have seen many people attaching .asc file. If I click on that, it reveals the other person's public key.
Is having an .asc file nothing but using the putting your public key and then renaming it as something like signature.asc or is something else involved as well ? The .asc file seems to be an archive file (like a .rar or zip file)
$ cat shirish-public-key.txt -----BEGIN PGP SIGNATURE----- publickeystring$ -----END PGP SIGNATURE-----
How can I make/transform it into an .asc file ?
I could just do -
$ mv shirish-public-key.txt shirish.asc
but I don't know if that is the right thing to do or not.
Update - I tried but it doesn't work :(
$ gpg --armor export shirish-public-key.txt > pubkey.asc gpg: WARNING: no command supplied. Trying to guess what you mean ... usage: gpg [options] [filename]
Update 2 - Still it doesn't work -
$ gpg --armor --export shirish-public-key.txt > pubkey.asc gpg: WARNING: nothing exported
seems it can't figure out that the public key is in a text file .
Update 3 -
This is what the contents of the file look like
But if I run -
$ gpg --import shirish-public-key.txt gpg: invalid radix64 character 3A skipped gpg: invalid radix64 character 2E skipped gpg: invalid radix64 character 2E skipped gpg: invalid radix64 character 2E skipped gpg: invalid radix64 character 3A skipped gpg: invalid radix64 character 3A skipped gpg: invalid radix64 character 2E skipped gpg: CRC error; 1E6A49 - B36DCC gpg: [don't know]: invalid packet (ctb=55) gpg: read_block: read error: Invalid packet gpg: import from 'shirish-public-key.txt' failed: Invalid keyring gpg: Total number processed: 0
Seems something is wrong somewhere.
FWIW gpg is version 2.2.5 from Debian testing (am running testing with all updates)
$ gpg --version gpg (GnuPG) 2.2.5 libgcrypt 1.8.2 Copyright (C) 2018 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Home: /home/shirish/.gnupg Supported algorithms: Pubkey: RSA, ELG, DSA, ECDH, ECDSA, EDDSA Cipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH, CAMELLIA128, CAMELLIA192, CAMELLIA256 Hash: SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224 Compression: Uncompressed, ZIP, ZLIB, BZIP2