summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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