Make AuthCertKeyIds sortable.
This commit is contained in:
parent
1148b2d79a
commit
168def3c28
|
@ -99,6 +99,22 @@ pub struct AuthCertKeyIds {
|
||||||
pub sk_fingerprint: rsa::RSAIdentity,
|
pub sk_fingerprint: rsa::RSAIdentity,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Ord for AuthCertKeyIds {
|
||||||
|
fn cmp(&self, other: &AuthCertKeyIds) -> std::cmp::Ordering {
|
||||||
|
use std::cmp::Ordering::Equal;
|
||||||
|
match self.id_fingerprint.cmp(&other.id_fingerprint) {
|
||||||
|
Equal => self.sk_fingerprint.cmp(&other.sk_fingerprint),
|
||||||
|
r => r,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl PartialOrd for AuthCertKeyIds {
|
||||||
|
fn partial_cmp(&self, other: &AuthCertKeyIds) -> Option<std::cmp::Ordering> {
|
||||||
|
Some(self.cmp(other))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// An authority certificate whose signature and validity time we
|
/// An authority certificate whose signature and validity time we
|
||||||
/// haven't checked.
|
/// haven't checked.
|
||||||
pub type UncheckedAuthCert = signed::SignatureGated<timed::TimerangeBound<AuthCert>>;
|
pub type UncheckedAuthCert = signed::SignatureGated<timed::TimerangeBound<AuthCert>>;
|
||||||
|
|
Loading…
Reference in New Issue