diff options
Diffstat (limited to 'ffi')
-rw-r--r-- | ffi/include/sequoia/openpgp.h | 5 | ||||
-rw-r--r-- | ffi/src/openpgp.rs | 10 |
2 files changed, 15 insertions, 0 deletions
diff --git a/ffi/include/sequoia/openpgp.h b/ffi/include/sequoia/openpgp.h index af136b53..64e6a1db 100644 --- a/ffi/include/sequoia/openpgp.h +++ b/ffi/include/sequoia/openpgp.h @@ -712,6 +712,11 @@ void sq_tsk_free (sq_tsk_t tsk); sq_tpk_t sq_tsk_tpk (sq_tsk_t tsk); /*/ +/// Converts the TSK into a TPK. +/*/ +sq_tpk_t sq_tsk_into_tpk (sq_tsk_t tsk); + +/*/ /// Serializes the TSK. /*/ sq_status_t sq_tsk_serialize (sq_context_t ctx, diff --git a/ffi/src/openpgp.rs b/ffi/src/openpgp.rs index 27df8ff5..1d23ad61 100644 --- a/ffi/src/openpgp.rs +++ b/ffi/src/openpgp.rs @@ -1048,6 +1048,16 @@ pub extern "system" fn sq_tsk_tpk(tsk: Option<&TSK>) tsk.tpk() } +/// Converts the TSK into a TPK. +#[no_mangle] +pub extern "system" fn sq_tsk_into_tpk(tsk: *mut TSK) + -> *mut TPK { + let tsk = unsafe { + Box::from_raw(tsk) + }; + box_raw!(tsk.into_tpk()) +} + /// Serializes the TSK. #[no_mangle] |