善用 --homedir
或環境變數 GNUPGHOME
來暫存及編輯公鑰,編輯後再匯出只帶有特定 email 的版本。
gpg --armor --export-key $keyid > key-with-origin-uid.asc
(umask 700; mkdir workdir)
export GNUPGHOME=workdir
gpg --import key-with-origin-uid.asc
gpg --edit-key $keyid
# use adduid to add new email address and name.
# use uid to select email.
# use deluid to delete selected email.
gpg --armor --export $keyid > key-without-delete-uid.asc
rm -rf $GNUPGHOME
export GNUPGHOME=''
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up