Module: EJSONWrapper
- Defined in:
- lib/ejson_wrapper.rb,
lib/ejson_wrapper/generate.rb,
lib/ejson_wrapper/decrypt_ejson_file.rb,
lib/ejson_wrapper/decrypt_private_key_with_kms.rb
Defined Under Namespace
Classes: DecryptEJSONFile, DecryptPrivateKeyWithKMS, Generate
Constant Summary
collapse
- KeygenFailed =
Class.new(StandardError)
- DecryptionFailed =
Class.new(StandardError)
- PrivateKeyNotFound =
Class.new(StandardError)
Class Method Summary
collapse
Class Method Details
.decrypt(file_path, key_dir: nil, private_key: nil, use_kms: false, region: nil) ⇒ Object
7
8
9
10
11
12
|
# File 'lib/ejson_wrapper.rb', line 7
def self.decrypt(file_path, key_dir: nil, private_key: nil, use_kms: false, region: nil)
if use_kms
private_key = private_key_decrypted(file_path, region: region)
end
DecryptEJSONFile.call(file_path, key_dir: key_dir, private_key: private_key)
end
|
.generate(**args) ⇒ Object
14
15
16
|
# File 'lib/ejson_wrapper.rb', line 14
def self.generate(**args)
Generate.new.call(**args)
end
|
.private_key_decrypted(file_path, region: nil) ⇒ Object
18
19
20
|
# File 'lib/ejson_wrapper.rb', line 18
def self.private_key_decrypted(file_path, region: nil)
DecryptPrivateKeyWithKMS.call(file_path, region: region)
end
|