Struct deltachat::e2ee::EncryptHelper
source · pub struct EncryptHelper {
pub prefer_encrypt: EncryptPreference,
pub addr: String,
pub public_key: SignedPublicKey,
}
Fields§
§prefer_encrypt: EncryptPreference
§addr: String
§public_key: SignedPublicKey
Implementations§
source§impl EncryptHelper
impl EncryptHelper
pub async fn new(context: &Context) -> Result<EncryptHelper>
pub fn get_aheader(&self) -> Aheader
sourcepub fn should_encrypt(
&self,
context: &Context,
e2ee_guaranteed: bool,
peerstates: &[(Option<Peerstate>, String)],
) -> Result<bool>
pub fn should_encrypt( &self, context: &Context, e2ee_guaranteed: bool, peerstates: &[(Option<Peerstate>, String)], ) -> Result<bool>
Determines if we can and should encrypt.
For encryption to be enabled, e2ee_guaranteed
should be true, or strictly more than a half
of peerstates should prefer encryption. Own preference is counted equally to peer
preferences, even if message copy is not sent to self.
e2ee_guaranteed
should be set to true for replies to encrypted messages (as required by
Autocrypt Level 1, version 1.1) and for messages sent in protected groups.
Returns an error if e2ee_guaranteed
is true, but one or more keys are missing.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EncryptHelper
impl RefUnwindSafe for EncryptHelper
impl Send for EncryptHelper
impl Sync for EncryptHelper
impl Unpin for EncryptHelper
impl UnwindSafe for EncryptHelper
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more