diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2018-12-28 16:24:07 +0100 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2018-12-28 16:26:14 +0100 |
commit | 252c51430560b2ca5a34aa9007adbfadaa6dab5a (patch) | |
tree | 8c25499793f05e6de62f634a9454eb892d2b131d | |
parent | 9d87c1b3d440a16214ee4562f086ec372fd5da7b (diff) |
ffi: Add sq_signature_to_packet.
-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 |