Class: RailsMasterKeyKmsDecrypter::Decryption
- Inherits:
-
Object
- Object
- RailsMasterKeyKmsDecrypter::Decryption
- Defined in:
- lib/rails_master_key_kms_decrypter/decryption.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
- #decrypt(value, **options) ⇒ Object
-
#initialize(client_options) ⇒ Decryption
constructor
A new instance of Decryption.
Constructor Details
#initialize(client_options) ⇒ Decryption
Returns a new instance of Decryption.
10 11 12 |
# File 'lib/rails_master_key_kms_decrypter/decryption.rb', line 10 def initialize() @client = Aws::KMS::Client.new() end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
8 9 10 |
# File 'lib/rails_master_key_kms_decrypter/decryption.rb', line 8 def client @client end |
Instance Method Details
#decrypt(value, **options) ⇒ Object
14 15 16 17 18 |
# File 'lib/rails_master_key_kms_decrypter/decryption.rb', line 14 def decrypt(value, **) decoded = Base64.strict_decode64(value) response = client.decrypt(ciphertext_blob: decoded, **) response.plaintext end |