IVSHPDNR6PQRZGJXJLPG2AG5GOXQLAALKD6WWBE4XYUEGAB24EHAC
Here’s the corresponding intergation work https://github.com/radicle-dev/radicle-keystore/pull/18
VK5CSP727IVAYHHI7FZJLES6F4YCR3S5GDSZHVPAR5XSPINGZEVAC
GNTMCGTBA3QCXVBC3AFD72CVFWLDS3N52M36ABWFLCBDQDNEYD5AC
I’m also including a patch for being generic on the runtime :)
As mentioned in https://nest.pijul.com/pijul/thrussh/discussions/46, the need for a generic key in
radicle-keystore#17
is only needed for the client.I explored this route by making
PublicKey
andKeyPair
generic in theclient.rs
file. The goal was then to move that code away fromthrussh-keys
. To do this, I decided to create two separate cratesthrussh-agent
andthrussh-encoding
. The latter is so that other packages that don’t want to rely onthrussh-keys
can use the encoding helpers defined in theencoding.rs
file.thrussh-agent
houses only theagent
code, i.e.client.rs
andserver.rs
. Any need for a key is handled by a set of traits defined inkey.rs
. These traits are:The
thrussh-keys
package depends onthrussh-agent
to have implementations of those traits forKeyPair
andPublicKey
.This was the most straightforward way to separate out the logic. We had discussed privately the option of
thrussh-keys
defining traits and having packages such asthrussh-libsodium
andthrussh-openssl
define keys and implement the traits. However, this ripped through all ofthrussh-keys
andthrussh
and became slightly unmanageable for me to implement. I was lacking enough knowledge and confidence to make these changes without worrying about complete breakage.I do think this separation could be a good stepping stone towards that implementing the above though. Where we could eventually move the traits to
thrussh-keys
,thrussh
could then be made generic over the keys and would have dependencies onthrussh-agent
andthrussh-keys
. Then the end-user could pick their key crate du jour. That would fit the auditing vision better too, because then the key logic is audited in each package, while the protocol logic is done viathrussh-agent
andthrussh
.I’ll submit the patches once I’ve cleaned up the messages :) I’ll also be submitted a draft patch to
radicle-keystore
showing the signing example working there.