diff options
Diffstat (limited to 'openpgp-ffi/src')
-rw-r--r-- | openpgp-ffi/src/packet_pile.rs | 13 | ||||
-rw-r--r-- | openpgp-ffi/src/tpk.rs | 13 | ||||
-rw-r--r-- | openpgp-ffi/src/tsk.rs | 14 |
3 files changed, 3 insertions, 37 deletions
diff --git a/openpgp-ffi/src/packet_pile.rs b/openpgp-ffi/src/packet_pile.rs index ad91bed3..e1aa97fe 100644 --- a/openpgp-ffi/src/packet_pile.rs +++ b/openpgp-ffi/src/packet_pile.rs @@ -24,7 +24,7 @@ use ::error::Status; /// /// [`sequoia-openpgp::PacketPile`]: ../../sequoia_openpgp/struct.PacketPile.html #[::ffi_wrapper_type(prefix = "pgp_", - derive = "Clone, Debug, PartialEq")] + derive = "Clone, Debug, PartialEq, Serialize")] pub struct PacketPile(openpgp::PacketPile); /// Deserializes the OpenPGP message stored in a `std::io::Read` @@ -71,14 +71,3 @@ fn pgp_packet_pile_from_bytes(errp: Option<&mut *mut ::error::Error>, openpgp::PacketPile::from_bytes(buf).move_into_raw(errp) } - -/// Serializes the packet pile. -#[::ffi_catch_abort] #[no_mangle] pub extern "system" -fn pgp_packet_pile_serialize(errp: Option<&mut *mut ::error::Error>, - packet_pile: *const PacketPile, - writer: *mut Box<Write>) - -> Status { - ffi_make_fry_from_errp!(errp); - let writer = ffi_param_ref_mut!(writer); - ffi_try_status!(packet_pile.ref_raw().serialize(writer)) -} diff --git a/openpgp-ffi/src/tpk.rs b/openpgp-ffi/src/tpk.rs index 90e88448..a17def26 100644 --- a/openpgp-ffi/src/tpk.rs +++ b/openpgp-ffi/src/tpk.rs @@ -53,7 +53,7 @@ use Maybe; /// /// [RFC 4880, section 11.1]: https://tools.ietf.org/html/rfc4880#section-11.1 #[::ffi_wrapper_type(prefix = "pgp_", name = "tpk", - derive = "Clone, Debug, Display, PartialEq")] + derive = "Clone, Debug, Display, PartialEq, Serialize")] pub struct TPK(openpgp::TPK); /// Returns the first TPK encountered in the reader. @@ -112,17 +112,6 @@ fn pgp_tpk_from_packet_parser(errp: Option<&mut *mut ::error::Error>, openpgp::TPK::from_packet_parser(*ppr).move_into_raw(errp) } -/// Serializes the TPK. -#[::ffi_catch_abort] #[no_mangle] pub extern "system" -fn pgp_tpk_serialize(errp: Option<&mut *mut ::error::Error>, - tpk: *const TPK, - writer: *mut Box<Write>) - -> Status { - let tpk = tpk.ref_raw(); - let writer = ffi_param_ref_mut!(writer); - tpk.serialize(writer).move_into_raw(errp) -} - /// Merges `other` into `tpk`. /// /// If `other` is a different key, then nothing is merged into diff --git a/openpgp-ffi/src/tsk.rs b/openpgp-ffi/src/tsk.rs index b3254456..2f77645e 100644 --- a/openpgp-ffi/src/tsk.rs +++ b/openpgp-ffi/src/tsk.rs @@ -28,7 +28,7 @@ use ::error::Status; /// /// [`sequoia-openpgp::TSK`]: ../../sequoia_openpgp/enum.TSK.html #[::ffi_wrapper_type(prefix = "pgp_", name = "tsk", - derive = "Clone, Debug, PartialEq")] + derive = "Clone, Debug, PartialEq, Serialize")] pub struct TSK(openpgp::TSK); /// Generates a new RSA 3072 bit key with UID `primary_uid`. @@ -65,15 +65,3 @@ fn pgp_tsk_into_tpk(tsk: *mut TSK) -> *mut TPK { tsk.move_from_raw().into_tpk().move_into_raw() } - - -/// Serializes the TSK. -#[::ffi_catch_abort] #[no_mangle] pub extern "system" -fn pgp_tsk_serialize(errp: Option<&mut *mut ::error::Error>, - tsk: *const TSK, - writer: *mut Box<Write>) - -> Status { - let tsk = tsk.ref_raw(); - let writer = ffi_param_ref_mut!(writer); - tsk.serialize(writer).move_into_raw(errp) -} |