added import

This commit is contained in:
alterNERDtive 2022-07-19 14:37:25 +02:00
parent 2ebd2761a0
commit cd4aa22291
Signed by: alterNERDtive
GPG key ID: 547787A4FE6533F1

14
gpgtool
View file

@ -213,7 +213,7 @@ create () {
mv /home/daniel/.gnupg/openpgp-revocs.d/${id}.rev ${keypath}/${id}/ mv /home/daniel/.gnupg/openpgp-revocs.d/${id}.rev ${keypath}/${id}/
echo "----- Restoring secret key for further modification …" echo "----- Restoring secret key for further modification …"
ln -sf ${keypath}/${id}/${keygrip}.key ${tempdir}/gpghome/private-keys-v1.d/ ln -sf ${keypath}/${id}/${keygrip}.key ${tempdir}/gpghome/private-keys-v1.d/
echo "----- Remember to send & close when done!" echo "----- Remember to import / send & close when done!"
} }
# Extends an open key. # Extends an open key.
@ -236,6 +236,7 @@ extend () {
cp ${keypath}/${id}/${id}.*.asc ${exdir} cp ${keypath}/${id}/${id}.*.asc ${exdir}
echo "----- Restoring secret key …" echo "----- Restoring secret key …"
ln -sf ${keypath}/${id}/${keygrip}.key ${tempdir}/gpghome/private-keys-v1.d/ ln -sf ${keypath}/${id}/${keygrip}.key ${tempdir}/gpghome/private-keys-v1.d/
echo -e "\nYou probably want to \`gpgtool import ${id}\` to load the updated key into your regular keyring."
} }
# Sends keys to key servers. # Sends keys to key servers.
@ -253,6 +254,17 @@ send () {
done done
} }
# Imports keys into your regular GnuPG keyring.
import () {
_checkinit
local keyfile=${keypath}/${id}/${id}.private.asc
[[ ! -f "${keyfile}" ]] && echo "Cannot find secret key ${keyfile}, aborting …" && exit 1
"Importing key into your regular GnuPG keying …"
gpg --import-options keep-ownertrust --import "${keyfile}"
}
# Prints usage information. # Prints usage information.
usage () { usage () {
echo FIXXME echo FIXXME