mirror of
https://git.asonix.dog/asonix/http-signature-normalization.git
synced 2024-11-24 18:31:01 +00:00
Implement DigestVerify for Tuples
This commit is contained in:
parent
a2bc8c03ee
commit
51bd0ad1ef
1 changed files with 33 additions and 0 deletions
|
@ -105,6 +105,39 @@ where
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<T, U> DigestVerify for (T, U)
|
||||||
|
where
|
||||||
|
T: DigestVerify,
|
||||||
|
U: DigestVerify,
|
||||||
|
{
|
||||||
|
fn verify(&mut self, parts: &[DigestPart], payload: &[u8]) -> bool {
|
||||||
|
self.0.verify(parts, payload) || self.1.verify(parts, payload)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<T, U, V> DigestVerify for (T, U, V)
|
||||||
|
where
|
||||||
|
T: DigestVerify,
|
||||||
|
U: DigestVerify,
|
||||||
|
V: DigestVerify,
|
||||||
|
{
|
||||||
|
fn verify(&mut self, parts: &[DigestPart], payload: &[u8]) -> bool {
|
||||||
|
self.0.verify(parts, payload) || self.1.verify(parts, payload) || self.2.verify(parts, payload)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<T, U, V, W> DigestVerify for (T, U, V, W)
|
||||||
|
where
|
||||||
|
T: DigestVerify,
|
||||||
|
U: DigestVerify,
|
||||||
|
V: DigestVerify,
|
||||||
|
W: DigestVerify,
|
||||||
|
{
|
||||||
|
fn verify(&mut self, parts: &[DigestPart], payload: &[u8]) -> bool {
|
||||||
|
self.0.verify(parts, payload) || self.1.verify(parts, payload) || self.2.verify(parts, payload) || self.3.verify(parts, payload)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl FromStr for DigestPart {
|
impl FromStr for DigestPart {
|
||||||
type Err = ParseDigestError;
|
type Err = ParseDigestError;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue