Bug 1612: Add optional HsIdKeypair to OnionServiceConfig
Resovles #1612 (closed)
Allows programmatically constructing OnionServices with an externally generated/stored HsIdKeypair. Adds an id_keypair member to the OnionServiceConfig
type, but directs serde to ignore (I presume this will prevent users from setting this member from a .toml config file; not sure if that is desired but it's the patch's intention).
This patch requires a pair of additional features:
- implementation of
Clone
,PartialEq
, andEq
forHsIdKeypair
(required to be stored on anOnionServiceConfig
) - addition of an overwrite flag to
KeyMgr::insert()
with identical semantisc toKeyMgr::generate()
's overwrite flag; the intention of this flag is to simplify+encapsulate the logic which I think makes sense in theOnionServiceBuilder::build()
method, namely that it should be considered an error to try to change an existing onion-service's ed25519 key (and therefore service-id)
Edited by morgan