Format ASN.1 time to string Formats certificate validity dates in the format: "Mon DD HH:MM:SS YYYY GMT"
(time: &x509_parser::time::ASN1Time)
| 195 | /// Formats certificate validity dates in the format: |
| 196 | /// "Mon DD HH:MM:SS YYYY GMT" |
| 197 | fn format_asn1_time(time: &x509_parser::time::ASN1Time) -> String { |
| 198 | let timestamp = time.timestamp(); |
| 199 | DateTime::<Utc>::from_timestamp(timestamp, 0) |
| 200 | .expect("ASN1Time must be valid timestamp") |
| 201 | .format("%b %e %H:%M:%S %Y GMT") |
| 202 | .to_string() |
| 203 | } |
| 204 | |
| 205 | /// Format certificate serial number to hexadecimal string with even padding |
| 206 | /// |
no test coverage detected