keyfork-derive-openpgp: add expiration for primary key via primary uid signature

This commit is contained in:
Ryan Heywood 2023-09-30 02:25:45 -05:00
parent 92f15489a4
commit 0a84d47a4d
Signed by: ryan
GPG Key ID: 8E401478A3FBEF72
1 changed files with 1 additions and 0 deletions

View File

@ -137,6 +137,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
let cert = let cert =
Cert::from_packets(vec![Packet::SecretKey(primary_key.clone())].into_iter()).unwrap(); Cert::from_packets(vec![Packet::SecretKey(primary_key.clone())].into_iter()).unwrap();
let builder = SignatureBuilder::new(SignatureType::PositiveCertification) let builder = SignatureBuilder::new(SignatureType::PositiveCertification)
.set_key_validity_period(one_day.duration_since(epoch)?)?
.set_signature_creation_time(epoch)? .set_signature_creation_time(epoch)?
.set_key_flags(subkey_format[0].inner().clone())?; .set_key_flags(subkey_format[0].inner().clone())?;
let binding = default_userid.bind(&mut primary_key.clone().into_keypair()?, &cert, builder)?; let binding = default_userid.bind(&mut primary_key.clone().into_keypair()?, &cert, builder)?;