Proca.Server.Keys (proca v3.4.1)
Process which contains a dictionary of encryption keys for orgs. It also generates unique nonce
values it is guaranteed they are not re-used if multiple actions are encrypted in parallel.
Stores encryption keys and nonces for each Org id
State is: {my_org_id, fn -> id_to_keys_map, nonce}
Link to this section Summary
Functions
Returns a specification to start this module under a supervisor.
Fetch all active public keys
Increment nonce by 1. Should be run after every successful encryption.
Initialize Key server with our org name.
Start Encrypt server
Link to this section Functions
child_spec(init_arg)
Returns a specification to start this module under a supervisor.
See Supervisor
.
encryption(from_to)
handle_continue(atom, arg)
Fetch all active public keys
increment_nonce(nonce)
Increment nonce by 1. Should be run after every successful encryption.
init(org_name)
Initialize Key server with our org name.
Pass the org name to handle_continue :get_keys to fetch all keys
start_link(org_name)
Start Encrypt server