Class: EventStoreClient::DataEncryptor

Inherits:
Object
  • Object
show all
Defined in:
lib/event_store_client/data_encryptor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#encrypted_dataObject (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_metadataObject (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

#callObject



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