Commit 19f000f4 authored by Janek Bevendorff's avatar Janek Bevendorff

Add command for publishing keys to key servers

parent 62359400
......@@ -331,7 +331,9 @@ get_card_key_fingerprint() {
### \b
### Print secret key associated with the smartcard.
### \b
### This only works if you have the subkey stubs in your public keyring.
### This only works if you have the secret key still in your public keyring.
### DO NOT USE THIS after stripping the secret key from your keyring!
### The resulting secret key will be a stub (and does not require a passphrase).
cmd_print_secret_key() {
key="$(get_card_key_fingerprint)"
if [ -z "$key" ]; then
......@@ -355,5 +357,22 @@ cmd_print_pubkey() {
gpg2 --armor --export "$key"
}
### Send public key to key server.
cmd_send_pubkey() {
key="$(get_card_key_fingerprint)"
if [ -z "$key" ]; then
logError "Couldn't get secret key info from card, you are probably missing subkey stubs."
return 1
fi
if ! yes_no_prompt "This will publish your public key on a key server. This step is irreversible. Continue?" "n"; then
logInfo "Not publishing key."
return
fi
if ! gpg2 --keyserver keys.gnupg.net --send-keys "$key"; then
logError "Publishing failed."
fi
}
exec_sub_cmd "$@"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment