aboutsummaryrefslogtreecommitdiff
path: root/lib/keyring/recipients.rb
blob: 4cd9a4876f6f9d791b9a5e225506f3c29f0d6348 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
module Keyring
  class Recipients
    def initialize(aBaseDirectory = '..')
      @recipientsStore = Backend::RecipientsStore.new(aBaseDirectory)

    end
    def addRecipient(anEmail, aKeySignature)

      @recipientsStore.load()
      @recipientsStore.addRecipient(anEmail, aKeySignature)
      @recipientsStore.save()
    end
    
    def removeRecipient(aKeySignature)
      @recipientsStore.load()
      @recipientsStore.removeRecipient(aKeySignature)
      @recipientsStore.save()
    end
    
    def listRecipients()
      @recipientsStore.load()
      
      return @recipientsStore.getRecipients()
    end
  end
end