summaryrefslogtreecommitdiffstats
path: root/openpgp-ffi
diff options
context:
space:
mode:
authorNeal H. Walfield <neal@pep.foundation>2020-03-18 09:53:09 +0100
committerNeal H. Walfield <neal@pep.foundation>2020-03-18 09:55:03 +0100
commita70b91cf4ce6358f214b082218e039156d08dccd (patch)
tree8b11cc27f6e1371df49dd8d7a7e12941b9009b39 /openpgp-ffi
parenta83045c43ab0c6f943075baa0145a937feef8c28 (diff)
openpgp-ffi: Add pgp_cert_builder_set_creation_time.
Diffstat (limited to 'openpgp-ffi')
-rw-r--r--openpgp-ffi/include/sequoia/openpgp.h6
-rw-r--r--openpgp-ffi/src/cert.rs11
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`.