Class: EventStoreClient::DataEncryptor
- Inherits:
-
Object
- Object
- EventStoreClient::DataEncryptor
- Defined in:
- lib/event_store_client/data_encryptor.rb
Instance Attribute Summary collapse
-
#encrypted_data ⇒ Object
readonly
Returns the value of attribute encrypted_data.
-
#encryption_metadata ⇒ Object
readonly
Returns the value of attribute encryption_metadata.
Instance Method Summary collapse
Instance Attribute Details
#encrypted_data ⇒ Object (readonly)
Returns the value of attribute encrypted_data.
18 19 20 |
# File 'lib/event_store_client/data_encryptor.rb', line 18 def encrypted_data @encrypted_data end |
#encryption_metadata ⇒ Object (readonly)
Returns the value of attribute encryption_metadata.
18 19 20 |
# File 'lib/event_store_client/data_encryptor.rb', line 18 def end |
Instance Method Details
#call ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/event_store_client/data_encryptor.rb', line 5 def call return encrypted_data if .empty? key_id = [:key] key = key_repository.find(key_id) || key_repository.create(key_id) [:iv] = key.iv encrypt_attributes( key: key, data: encrypted_data, attributes: [:attributes] ) end |