Open RolandSherwin opened 3 weeks ago
changing the sk would only affect 1 instance of the client and not all the clones.
That's correct and I think that's desirable; apps will most likely work with many different keys to sign reqs. and/or encrypt content, so they may use different Client instances, each of them with these different keys set.
If so, would it be possible to maybe provide the keys during the init of client rather than with Client::set_signer_key
?
Since set_signer_key
can be easily overlooked and the caller would expect all the instance to have the updated value?
Currently the client secret key can be modified with this public interface
Client::set_signer_key
, but since client is assumed to be freely-clonable without any mutable states, changing the sk would only affect 1 instance of the client and not all the clones.This is currently used inside
acc-packet::init
to update the Client sk withroot_sk.dervide_sk()
. So maybe we should just initialize the Client with thisroot_sk.dervide_sk()
or introduceRwLock<SK>
, but the lock would run deep into Registers and that might not be a good approach.c.c @bochaco