Class: Duse::Client::CreateSecret::CreatableSecret

Inherits:
Object
  • Object
show all
Defined in:
lib/duse/client/secret.rb

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ CreatableSecret

Returns a new instance of CreatableSecret.



50
51
52
# File 'lib/duse/client/secret.rb', line 50

def initialize(options)
  @options = options
end

Instance Method Details

#buildObject



54
55
56
57
58
59
60
61
62
# File 'lib/duse/client/secret.rb', line 54

def build
  cipher_text, shares = Encryption.encrypt(@options[:secret_text], @options[:users], @options[:private_key])
  {
    title: @options[:title],
    cipher_text: cipher_text,
    shares: shares,
    folder_id: @options[:folder_id]
  }
end