Look to Subj: How to get public key from private in gpg without using local storage (under ~/.gpg)?
This solution does not satisfy requirements:
$ gpg --import priv.key $ gpg --export $KEYID >pub.key $ gpg --delete-secret-and-public-key $KEYID
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I don’t understand why you aren’t happy with the solution you have already come up with, but if for some reason you really want to avoid messing with your personal keyrings, I can offer something else:
Or as a convenient BASH function: