diff options
author | Neal H. Walfield <neal@pep.foundation> | 2020-03-18 09:53:09 +0100 |
---|---|---|
committer | Neal H. Walfield <neal@pep.foundation> | 2020-03-18 09:55:03 +0100 |
commit | a70b91cf4ce6358f214b082218e039156d08dccd (patch) | |
tree | 8b11cc27f6e1371df49dd8d7a7e12941b9009b39 /openpgp-ffi | |
parent | a83045c43ab0c6f943075baa0145a937feef8c28 (diff) |
openpgp-ffi: Add pgp_cert_builder_set_creation_time.
Diffstat (limited to 'openpgp-ffi')
-rw-r--r-- | openpgp-ffi/include/sequoia/openpgp.h | 6 | ||||
-rw-r--r-- | openpgp-ffi/src/cert.rs | 11 |
2 files changed, 17 insertions, 0 deletions
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 @@ -1037,6 +1037,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. /// /// Consumes `certb`. 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`. |