Currently, one of the options for a keypair is:
Remote(Box<dyn RemoteKeyPair + Send + Sync>),
Although workable, it feels like a RemoteKeyPair shouldn't be owned and could be borrowed instead. This is useful in some situations where the RemoteKeyPair could be shared or for more control over the workflow.
I have already implemented this, although the downside is that it pollutes the code with mandatory lifetime annotations. I plan to prepare and submit a PR soon with these changes in case there's any interest.
Quick summary of changes:
- Borrowed RemoteKeyPair
- Cleaned up
sign to separate the DER-parts from the signature parts.
- I guess mostly useful for testing, implemented the
RemoteKeyPair trait for KeyPair, so it's possible to do KeyPair::from_remote(&key_pair) (although it's not possible to do key_pair.as_remote()).
Currently, one of the options for a keypair is:
Although workable, it feels like a
RemoteKeyPairshouldn't be owned and could be borrowed instead. This is useful in some situations where the RemoteKeyPair could be shared or for more control over the workflow.I have already implemented this, although the downside is that it pollutes the code with mandatory lifetime annotations. I plan to prepare and submit a PR soon with these changes in case there's any interest.
Quick summary of changes:
signto separate the DER-parts from the signature parts.RemoteKeyPairtrait forKeyPair, so it's possible to doKeyPair::from_remote(&key_pair)(although it's not possible to dokey_pair.as_remote()).