Skip to content

Support for borrowed RemoteKeyPair #211

@corrideat

Description

@corrideat

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:

  1. Borrowed RemoteKeyPair
  2. Cleaned up sign to separate the DER-parts from the signature parts.
  3. 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()).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions