Always use created date from YubiKey certificate
This commit is contained in:
Generated
-1
@@ -51,7 +51,6 @@ dependencies = [
|
||||
"age-plugin",
|
||||
"base64",
|
||||
"bech32",
|
||||
"chrono",
|
||||
"console",
|
||||
"dialoguer",
|
||||
"env_logger",
|
||||
|
||||
@@ -26,7 +26,6 @@ age-core = "0.5"
|
||||
age-plugin = "0.0"
|
||||
base64 = "0.13"
|
||||
bech32 = "0.8"
|
||||
chrono = "0.4"
|
||||
console = "0.14"
|
||||
dialoguer = "0.8"
|
||||
env_logger = "0.8"
|
||||
|
||||
+5
-2
@@ -123,7 +123,7 @@ impl IdentityBuilder {
|
||||
.name
|
||||
.unwrap_or(format!("age identity {}", hex::encode(stub.tag)));
|
||||
|
||||
Certificate::generate_self_signed(
|
||||
let cert = Certificate::generate_self_signed(
|
||||
yubikey,
|
||||
SlotId::Retired(slot),
|
||||
serial,
|
||||
@@ -140,10 +140,13 @@ impl IdentityBuilder {
|
||||
)],
|
||||
)?;
|
||||
|
||||
let (_, cert) = x509_parser::parse_x509_certificate(cert.as_ref()).unwrap();
|
||||
let created = cert.validity().not_before.to_rfc2822();
|
||||
|
||||
Ok((
|
||||
Stub::new(yubikey.serial(), slot, &recipient),
|
||||
recipient,
|
||||
chrono::Local::now().to_rfc3339_opts(chrono::SecondsFormat::Secs, true),
|
||||
created,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user