From a70b91cf4ce6358f214b082218e039156d08dccd Mon Sep 17 00:00:00 2001 From: "Neal H. Walfield" Date: Wed, 18 Mar 2020 09:53:09 +0100 Subject: openpgp-ffi: Add pgp_cert_builder_set_creation_time. --- openpgp-ffi/include/sequoia/openpgp.h | 6 ++++++ openpgp-ffi/src/cert.rs | 11 +++++++++++ 2 files changed, 17 insertions(+) (limited to 'openpgp-ffi') diff --git a/openpgp-ffi/include/sequoia/openpgp.h b/openpgp-ffi/include/sequoia/openpgp.h index 69856832..e08a4901 100644 --- a/openpgp-ffi/include/sequoia/openpgp.h +++ b/openpgp-ffi/include/sequoia/openpgp.h @@ -1036,6 +1036,12 @@ void pgp_cert_builder_add_transport_encryption_subkey(pgp_cert_builder_t *certb) /*/ void pgp_cert_builder_add_certification_subkey(pgp_cert_builder_t *certb); +/*/ +/// Sets the creation time. +/*/ +void pgp_cert_builder_set_creation_time(pgp_cert_builder_t *certb, + time_t when); + /*/ /// Generates the actual Cert. /// diff --git a/openpgp-ffi/src/cert.rs b/openpgp-ffi/src/cert.rs index f25296ef..4dd2953f 100644 --- a/openpgp-ffi/src/cert.rs +++ b/openpgp-ffi/src/cert.rs @@ -986,6 +986,17 @@ pub extern "C" fn pgp_cert_builder_add_certification_subkey *certb = box_raw!(certb_); } +/// Sets the creation time. +#[::sequoia_ffi_macros::extern_fn] #[no_mangle] +pub extern "C" fn pgp_cert_builder_set_creation_time + (certb: *mut *mut CertBuilder, when: time_t) +{ + let certb = ffi_param_ref_mut!(certb); + let certb_ = ffi_param_move!(*certb); + let certb_ = certb_.set_creation_time(maybe_time(when)); + *certb = box_raw!(certb_); +} + /// Generates the actual Cert. /// /// Consumes `certb`. -- cgit v1.2.3