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(crate) async fn should_encrypt(
&self,
context: &Context,
peerstates: &[(Option<Peerstate>, String)],
) -> Result<bool>
pub(crate) async fn should_encrypt( &self, context: &Context, peerstates: &[(Option<Peerstate>, String)], ) -> Result<bool>
Determines if we can and should encrypt.
Sourcepub(crate) fn encryption_keyring(
&self,
context: &Context,
verified: bool,
peerstates: &[(Option<Peerstate>, String)],
) -> Result<(Vec<SignedPublicKey>, BTreeSet<String>)>
pub(crate) fn encryption_keyring( &self, context: &Context, verified: bool, peerstates: &[(Option<Peerstate>, String)], ) -> Result<(Vec<SignedPublicKey>, BTreeSet<String>)>
Constructs a vector of public keys for given peerstates.
In addition returns the set of recipient addresses for which there is no key available.
Returns an error if there are recipients other than self, but no recipient keys are available.
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