-
Notifications
You must be signed in to change notification settings - Fork 1
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
Passing Ring types and not a T: Read? #8
Comments
That's a good point, actually. I was still fairly new to how APIs and stuff should be structured and how things in rust work, but I figured allowing people to supply I think I'll go ahead and update this library to do that this weekend |
oh, thanks for the response! that sounds good. |
I've updated the crate to now take an |
actually, it might make the MOST sense to do something like enum Key {
RSA(RsaKeyPair),
HMAC(SigningKey),
}
impl From<RsaKeyPair> for Key {
fn from(key: RsaKeyPair) -> Self {
Key::RSA(key)
}
}
impl From<SigningKey> for Key {
fn from(key: SigningKey) -> Self {
Key::HMAC(key)
}
}
fn verify<K: Into<Key>>(..., key: K, ...) {
...
} |
what are your thoughts? |
I tried my hand at the https://git.asonix.dog/asonix/http-signatures/pulls/1 my main issue is that |
ahhhhhhhhhhhh, hmmm. i like the is it possible to impl |
I'd actually prefer not to use TryFrom. My most recent changes work without TryFrom, and actually the base library compiles on stable rust now (everything works except rocket). As far as Maybe a greater refactoring is in order, and maybe I just need to split the logic for HMAC from the logic for RSA. Who's even going to be using HMAC HTTP Signatures anyway? |
I think I prefer the |
ahhhhhhhh, i see yeah |
Here's the release with try it out and let me know what could be better |
thanks! i'm gonna be working on httpsigs in rustodon soon so i'll let you know... |
What was the rationale behind the http_signatures API taking readers into key files (and, for RSA, parsing the DER inside http_signatures) instead of passing, eg,
ring::signature::RSAKeyPair
orring::hmac::SigningKey
?(yes, i know the project has been moved to your gitea, but i can't leave issues there 😄)
The text was updated successfully, but these errors were encountered: