aboutsummaryrefslogtreecommitdiff
path: root/bin/ak-gpg
diff options
context:
space:
mode:
Diffstat (limited to 'bin/ak-gpg')
-rwxr-xr-xbin/ak-gpg12
1 files changed, 9 insertions, 3 deletions
diff --git a/bin/ak-gpg b/bin/ak-gpg
index 3acfc0b..3bbd736 100755
--- a/bin/ak-gpg
+++ b/bin/ak-gpg
@@ -26,6 +26,8 @@
## --get-key-self-as-ipfs Returns your key as an IPFS hash
## --get-key-self-as-fingerprint Returns the fingerprint of your key
## --get-key-fingerprint-from-ipfs Returns the fingerprint of a given key
+## --export-key <fingerprint> <out> Exports a public key as <out> filename
+## --export-selected-key Selects a key to export
## --export-key-self-to-file Exports self public key as 'self.pub'
## --clear-sign <file> <output> Sign a file clearly
## --verify-file <file> Verify a clear signed file
@@ -39,6 +41,7 @@
## plain GPG output
## -lsl, --list-secret-keys-long Returns a list of secret GPG keys with
## their 1st uid
+## -i, --import-key <file> Imports a GPG key from a <file>
## -c, --create-key <email> Creates a GPG key with a label <email>
## -s, --select-key Selects the GPG key you want to use
## -d, --delete-key Delete GPG keys from your keyring
@@ -62,11 +65,12 @@ _ak_lib_load _ak_gpg
if [ ! -z $1 ]; then
case $1 in
-h | --help) _ak_usage; exit;;
- --example) example; exit;;
--get-key-self-as-ipfs) _ak_gpg_key_self_get_fingerprint_from_config; exit;;
--get-key-self-as-fingerprint) _ak_gpg_key_self_get_fingerprint; exit;;
--get-key-fingerprint-from-ipfs) shift; _ak_gpg_key_get_fingerprint_from_ipfs $1; exit;;
--export-key-self-to-file) _ak_gpg_key_self_export 'self.pub'; exit;;
+ --export-selected-key) _ak_gpg_select_key_to_export; exit;;
+ --export-key) _ak_gpg_key_export "$2" "$3"; exit;;
--clear-sign) shift; _ak_gpg_sign_clear "$2" "$1"; exit;;
--verify-file) shift; _ak_gpg_verify_clear_signature "$1"; exit;;
--list-keys | -l) _ak_gpg_list_keys; exit;;
@@ -75,12 +79,14 @@ if [ ! -z $1 ]; then
--list-secret-keys | -ls) _ak_gpg_list_secret_keys; exit;;
--list-secret-keys-long | -lsl) _ak_gpg_list_secret_keys_long; exit;;
--list-secret-keys-plain | -lsp) _ak_gpg_list_secret_keys_plain; exit;;
+ --import-key | -i) shift; _ak_gpg_key_import_from_file $1; exit;;
--create-key | -c) shift; _ak_gpg_create_key $1; exit;;
--select-key | -s) _ak_gpg_select_key; exit;;
--delete-key | -d) _ak_gpg_delete_key; exit;;
--delete-secret-key | -ds) shift; _ak_gpg_delete_secret_key $1; exit;;
--run | -r) shift; _ak_gpg $*; exit;;
- * ) _ak_usage;;
+ * ) _ak_usage err;;
esac
-else _ak_usage
+else
+ _ak_usage err
fi