From 6953b4f9902f5f524e92a15518d0132fb662704a Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Thu, 6 Feb 2020 17:46:56 +0100 Subject: autocrypt: New crate. - Move the autocrypt-related functionality to a new crate. - Fixes #424. --- openpgp-ffi/src/cert.rs | 24 ------------------------ 1 file changed, 24 deletions(-) (limited to 'openpgp-ffi/src') diff --git a/openpgp-ffi/src/cert.rs b/openpgp-ffi/src/cert.rs index ca8a9cf7..b0ca0275 100644 --- a/openpgp-ffi/src/cert.rs +++ b/openpgp-ffi/src/cert.rs @@ -11,7 +11,6 @@ use libc::{c_char, c_int, size_t, time_t}; extern crate sequoia_openpgp as openpgp; use self::openpgp::{ - autocrypt::Autocrypt, crypto, types::ReasonForRevocation, parse::{ @@ -920,29 +919,6 @@ pub extern "C" fn pgp_cert_builder_general_purpose(cs: c_int, Some(int_to_cipher_suite(cs)), uid)) } -/// Generates a key compliant to [Autocrypt Level 1]. -/// -/// Autocrypt requires a user id, however, if `uid` is NULL, a Cert is -/// created without any user ids. It is then the caller's -/// responsibility to ensure that a user id is added later. -/// -/// `uid` must contain valid UTF-8. If it does not contain valid -/// UTF-8, then the invalid code points are silently replaced with -/// `U+FFFD REPLACEMENT CHARACTER`. -/// -/// [Autocrypt Level 1]: https://autocrypt.org/level1.html -#[::sequoia_ffi_macros::extern_fn] #[no_mangle] -pub extern "C" fn pgp_cert_builder_autocrypt(uid: *const c_char) - -> *mut CertBuilder -{ - let uid = if uid.is_null() { - None - } else { - Some(ffi_param_cstr!(uid).to_string_lossy()) - }; - box_raw!(CertBuilder::autocrypt(Autocrypt::V1, uid)) -} - /// Frees an `pgp_cert_builder_t`. #[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn pgp_cert_builder_free(certb: Option<&mut CertBuilder>) -- cgit v1.2.3