1
0
mirror of https://github.com/pcvolkmer/cert-tools.git synced 2025-07-01 14:02:54 +00:00

chore: some code cleanup

This commit is contained in:
2025-01-06 17:15:19 +01:00
parent f26b486553
commit 8e898cf4bb
2 changed files with 6 additions and 6 deletions

View File

@ -31,7 +31,7 @@ use std::time::{SystemTime, UNIX_EPOCH};
pub fn hex_encode<T: AsRef<[u8]>>(s: T) -> String {
s.as_ref()
.iter()
.map(|b| format!("{:02x}", b))
.map(|b| format!("{b:02x}"))
.collect::<Vec<_>>()
.join(":")
.to_ascii_uppercase()
@ -242,7 +242,7 @@ impl Certificate {
}
}
pub fn public_key_matches(&self, private_key: PrivateKey) -> bool {
pub fn public_key_matches(&self, private_key: &PrivateKey) -> bool {
if self.key_modulo().to_string() == private_key.modulus.to_string() {
return true;
}
@ -306,7 +306,7 @@ impl Chain {
}
x = match cert.public_key() {
Ok(public_key) => Some(public_key),
Err(_) => None,
Err(()) => None,
}
}
!time_issue && !self.certs.is_empty()