Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

signature: add traits to obtain verifier objects #1363

Closed
wants to merge 1 commit into from

Conversation

fjarri
Copy link
Contributor

@fjarri fjarri commented Oct 18, 2023

I occasionally encounter situations where I need to get a verifier from a signer, and have to pass both to a method since there's currently no generic mechanism to do that. ecdsa::SigningKey has a verifying_key() method, but it's not in any trait, so if my code is generic over Signer/Verifier traits, I can't use it.

Would it make sense to add a trait for that connection? Are there any situations where a signer object does not allow one to obtain the corresponding verifier? If not, we can even bound Singer<S>: HasVerifier<S>.

@tarcieri
Copy link
Member

tarcieri commented Oct 18, 2023

The Keypair trait is intended to fulfill this purpose. It's also impl'd in all of the relevant crates already.

@fjarri
Copy link
Contributor Author

fjarri commented Oct 18, 2023

My bad, I think that will cover my use cases. Closing the PR.

@fjarri fjarri closed this Oct 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants