summaryrefslogtreecommitdiffstats
path: root/ffi
diff options
context:
space:
mode:
authorNeal H. Walfield <neal@pep.foundation>2018-11-22 11:12:24 +0100
committerNeal H. Walfield <neal@pep.foundation>2018-11-22 11:12:24 +0100
commitb38f5031373dd32ac4212a510283b724d8fa27b4 (patch)
treee02d2d22f1423343ab9b69e7ce77e8ff1cf33812 /ffi
parent6a837c6fb88d0320076df53129b22f44eb3ee060 (diff)
ffi: Wrap PKESK::Recipient.
- Add sq_pkesk_recipient.
Diffstat (limited to 'ffi')
-rw-r--r--ffi/include/sequoia/openpgp.h5
-rw-r--r--ffi/src/openpgp.rs11
2 files changed, 16 insertions, 0 deletions
diff --git a/ffi/include/sequoia/openpgp.h b/ffi/include/sequoia/openpgp.h
index 63e1ff6e..1d11a113 100644
--- a/ffi/include/sequoia/openpgp.h
+++ b/ffi/include/sequoia/openpgp.h
@@ -514,6 +514,11 @@ sq_keyid_t sq_signature_issuer(sq_signature_t sig);
/*/
sq_fingerprint_t sq_signature_issuer_fingerprint(sq_signature_t sig);
+/// 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);
/*/
/// Returns the session key.
diff --git a/ffi/src/openpgp.rs b/ffi/src/openpgp.rs
index fd4db5e6..8f035e0d 100644
--- a/ffi/src/openpgp.rs
+++ b/ffi/src/openpgp.rs
@@ -1488,6 +1488,17 @@ pub extern "system" fn sq_skesk_decrypt(ctx: Option<&mut Context>,
}
}
+/// Returns the PKESK's recipient.
+///
+/// The return value is a reference ot a `KeyID`. The caller must not
+/// modify or free it.
+#[no_mangle]
+pub extern "system" fn sq_pkesk_recipient(pkesk: Option<&PKESK>)
+ -> *const KeyID {
+ let pkesk = pkesk.expect("PKESK is NULL");
+ pkesk.recipient()
+}
+
/// Returns the session key.
///
/// `key` of size `key_len` must be a buffer large enough to hold the