Class: Voynich::KMSDataKeyClient
- Inherits:
-
Object
- Object
- Voynich::KMSDataKeyClient
- Defined in:
- lib/voynich/kms_data_key_client.rb
Defined Under Namespace
Classes: Result
Instance Attribute Summary collapse
-
#cmk_id ⇒ Object
readonly
Returns the value of attribute cmk_id.
Instance Method Summary collapse
- #decrypt(ciphertext) ⇒ Object
- #generate ⇒ Object
-
#initialize(cmk_id) ⇒ KMSDataKeyClient
constructor
A new instance of KMSDataKeyClient.
- #reencrypt(ciphertext) ⇒ Object
Constructor Details
#initialize(cmk_id) ⇒ KMSDataKeyClient
Returns a new instance of KMSDataKeyClient.
7 8 9 |
# File 'lib/voynich/kms_data_key_client.rb', line 7 def initialize(cmk_id) @cmk_id = cmk_id end |
Instance Attribute Details
#cmk_id ⇒ Object (readonly)
Returns the value of attribute cmk_id.
5 6 7 |
# File 'lib/voynich/kms_data_key_client.rb', line 5 def cmk_id @cmk_id end |
Instance Method Details
#decrypt(ciphertext) ⇒ Object
11 12 13 14 |
# File 'lib/voynich/kms_data_key_client.rb', line 11 def decrypt(ciphertext) response = kms_client.decrypt(ciphertext_blob: decode(ciphertext)) Result.new(encode(response.plaintext), ciphertext) end |