feat: update x509-parser version

This commit is contained in:
2023-08-26 12:25:04 +08:00
parent 1698e2d9f8
commit ffd0e6233f
4 changed files with 19 additions and 23 deletions

View File

@@ -113,7 +113,7 @@ fn print_cert_info(yubikey: &mut YubiKey, slot: SlotId, detail_output: bool) ->
information!("Issuer: {}", cert.tbs_certificate.issuer);
information!("Certificate fingerprint(SHA256): {}", hex::encode(certificate_fingerprint_sha256));
information!("Public key fingerprint(SHA256): {}", hex::encode(public_key_fingerprint_sha256));
information!("Not Before: {}", cert.tbs_certificate.validity.not_before.to_rfc2822());
information!("Not Before: {}", cert.tbs_certificate.validity.not_before.to_rfc2822().unwrap_or_else(|e| format!("Err: {}", e)));
let mut not_after_desc = String::new();
let not_after_timestamp = cert.tbs_certificate.validity.not_after.timestamp();
@@ -125,7 +125,10 @@ fn print_cert_info(yubikey: &mut YubiKey, slot: SlotId, detail_output: bool) ->
let valid_time = simpledateformat::format_human(Duration::from_secs((not_after_timestamp - now_timestamp) as u64));
not_after_desc.push_str(&format!("(left {})", valid_time));
}
information!("Not After: {} {}", cert.tbs_certificate.validity.not_after.to_rfc2822(), not_after_desc);
information!("Not After: {} {}",
cert.tbs_certificate.validity.not_after.to_rfc2822().unwrap_or_else(|e| format!("Err: {}", e)),
not_after_desc
);
}
_ => {
warning!("Failed to parse certificate");