summaryrefslogtreecommitdiffstats
path: root/ffi/include
diff options
context:
space:
mode:
authorNeal H. Walfield <neal@pep.foundation>2018-12-17 20:59:47 +0100
committerNeal H. Walfield <neal@pep.foundation>2018-12-17 21:01:08 +0100
commitb90d6d4b4968a27a6d7cfd70a67db1125a29b099 (patch)
tree733cafc85c77d1367dcf43076e931f743d4520b5 /ffi/include
parenta3bd8dd4c18fed9167ebf0c411ad793ba96b29d7 (diff)
ffi: Wrap Signature's alive and expired methods.
- Wrap Signature::signature_alive, Signature::signature_alive_at, Signature::signature_expired, and Signature::signature_expired_at. - Rely on the time crate to convert time_t to a time::Tm.
Diffstat (limited to 'ffi/include')
-rw-r--r--ffi/include/sequoia/openpgp.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/ffi/include/sequoia/openpgp.h b/ffi/include/sequoia/openpgp.h
index d949ee01..dcdc3d73 100644
--- a/ffi/include/sequoia/openpgp.h
+++ b/ffi/include/sequoia/openpgp.h
@@ -2,6 +2,7 @@
#define SEQUOIA_OPENPGP_H
#include <sequoia/core.h>
+#include <time.h>
/* sequoia::openpgp::KeyID. */
@@ -560,10 +561,39 @@ int sq_signature_is_split_key(sq_signature_t signature);
/// key.
/*/
int sq_signature_is_group_key(sq_signature_t signature);
+
+/*/
+/// Returns whether the signature is alive.
+///
+/// A signature is alive if the creation date is in the past, and the
+/// signature has not expired.
+/*/
+int sq_signature_alive(sq_signature_t signature);
+
+/*/
+/// Returns whether the signature is alive at the specified time.
+///
+/// A signature is alive if the creation date is in the past, and the
+/// signature has not expired at the specified time.
+/*/
+int sq_signature_alive_at(sq_signature_t signature, time_t when);
+
+/*/
+/// Returns whether the signature is expired.
+/*/
+int sq_signature_expired(sq_signature_t signature);
+
+/*/
+/// Returns whether the signature is expired at the specified time.
+/*/
+int sq_signature_expired_at(sq_signature_t signature, time_t when);
+
+/*/
/// Returns the PKESK's recipient.
///
/// The return value is a reference ot a `KeyID`. The caller must not
/// modify or free it.
+/*/
sq_keyid_t sq_pkesk_recipient(sq_pkesk_t pkesk);
/*/