diff options
-rw-r--r-- | ffi/include/sequoia/openpgp.h | 5 | ||||
-rw-r--r-- | ffi/src/openpgp.rs | 11 |
2 files changed, 16 insertions, 0 deletions
diff --git a/ffi/include/sequoia/openpgp.h b/ffi/include/sequoia/openpgp.h index 01aa1aab..88d43863 100644 --- a/ffi/include/sequoia/openpgp.h +++ b/ffi/include/sequoia/openpgp.h @@ -539,6 +539,11 @@ sq_status_t sq_packet_pile_serialize (sq_context_t ctx, void sq_signature_free (sq_signature_t signature); /*/ +/// Converts the signature to a packet. +/*/ +sq_packet_t sq_signature_to_packet (sq_signature_t signature); + +/*/ /// Returns the value of the `Signature` packet's Issuer subpacket. /// /// If there is no Issuer subpacket, this returns NULL. Note: if diff --git a/ffi/src/openpgp.rs b/ffi/src/openpgp.rs index 9b994724..cddc4848 100644 --- a/ffi/src/openpgp.rs +++ b/ffi/src/openpgp.rs @@ -1521,6 +1521,17 @@ pub extern "system" fn sq_signature_free(s: *mut Signature) { } } +/// Converts the signature to a packet. +#[no_mangle] +pub extern "system" fn sq_signature_to_packet(s: *mut Signature) + -> *mut Packet +{ + assert!(! s.is_null()); + unsafe { + box_raw!(Box::from_raw(s).to_packet()) + } +} + /// Returns the value of the `Signature` packet's Issuer subpacket. /// /// If there is no Issuer subpacket, this returns NULL. Note: if |