fix: 证书生成时间改为10年

main
Zaeyee 2024-09-27 16:02:41 +08:00
parent 1b41274823
commit 317c2040a7
1 changed files with 1 additions and 1 deletions

View File

@ -66,7 +66,7 @@ fn gen_rsa_pair(merchant_id: &str, email: &str, save_path: &str) -> Result<(), E
x509_builder.set_issuer_name(&x509_name)?; x509_builder.set_issuer_name(&x509_name)?;
x509_builder.set_pubkey(&private_key)?; x509_builder.set_pubkey(&private_key)?;
let not_before = Asn1Time::days_from_now(0)?; let not_before = Asn1Time::days_from_now(0)?;
let not_after = Asn1Time::days_from_now(1095)?; let not_after = Asn1Time::days_from_now(3650)?;
x509_builder.set_not_before(&not_before)?; x509_builder.set_not_before(&not_before)?;
x509_builder.set_not_after(&not_after)?; x509_builder.set_not_after(&not_after)?;
x509_builder.sign(&private_key, MessageDigest::sha256())?; x509_builder.sign(&private_key, MessageDigest::sha256())?;