aboutsummaryrefslogtreecommitdiff
path: root/lib/keyringer/actions/recipients.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/keyringer/actions/recipients.rb')
-rw-r--r--lib/keyringer/actions/recipients.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/keyringer/actions/recipients.rb b/lib/keyringer/actions/recipients.rb
new file mode 100644
index 0000000..c5f30ed
--- /dev/null
+++ b/lib/keyringer/actions/recipients.rb
@@ -0,0 +1,25 @@
+module Keyringer
+ module Actions
+ class Recipients
+ def execute
+ subCommand = $args[0]
+
+ recipients = Keyring::Recipients.new
+
+ if subCommand == "add"
+ recipients.addRecipient($args[1], $args[2])
+ elsif subCommand == "remove"
+ recipients.removeRecipient($args[1])
+ elsif subCommand == "list"
+ recipients.listRecipients().each() do |recipient|
+ puts("#{recipient.email} #{recipient.keySignature}")
+ end
+ else
+ throw "Invalid recipients command: #{subCommand} "
+ end
+
+ return ""
+ end
+ end
+ end
+end