pub struct PkEncryption { /* private fields */ }
Expand description
The encryption component of PkEncryption support.
This struct can be created using a Curve25519PublicKey
corresponding to
a PkDecryption
object, allowing messages to be encrypted for the
associated decryption object.
Implementations§
Source§impl PkEncryption
impl PkEncryption
Sourcepub fn from_base64(key: &str) -> Result<Arc<Self>, DecodeError>
pub fn from_base64(key: &str) -> Result<Arc<Self>, DecodeError>
Create a new PkEncryption
object from a Curve25519PublicKey
encoded as Base64.
The public key should come from an existing PkDecryption
object.
Returns a DecodeError
if the Curve25519 key could not be decoded
correctly.
Sourcepub fn encrypt(&self, plaintext: &str) -> PkMessage
pub fn encrypt(&self, plaintext: &str) -> PkMessage
Encrypt a message using this PkEncryption
object.
Trait Implementations§
Source§impl<UT> LiftRef<UT> for PkEncryption
impl<UT> LiftRef<UT> for PkEncryption
type LiftType = Arc<PkEncryption>
Source§impl<UT> LowerError<UT> for PkEncryption
impl<UT> LowerError<UT> for PkEncryption
Source§fn lower_error(obj: Self) -> RustBuffer
fn lower_error(obj: Self) -> RustBuffer
Lower this value for scaffolding function return Read more
Source§impl<UT> LowerReturn<UT> for PkEncryption
impl<UT> LowerReturn<UT> for PkEncryption
Source§type ReturnType = <Arc<PkEncryption> as LowerReturn<UniFfiTag>>::ReturnType
type ReturnType = <Arc<PkEncryption> as LowerReturn<UniFfiTag>>::ReturnType
The type that should be returned by scaffolding functions for this type. Read more
Source§fn lower_return(obj: Self) -> Result<Self::ReturnType, RustBuffer>
fn lower_return(obj: Self) -> Result<Self::ReturnType, RustBuffer>
Lower this value for scaffolding function return Read more
Source§impl<UT> TypeId<UT> for PkEncryption
impl<UT> TypeId<UT> for PkEncryption
Auto Trait Implementations§
impl Freeze for PkEncryption
impl RefUnwindSafe for PkEncryption
impl Send for PkEncryption
impl Sync for PkEncryption
impl Unpin for PkEncryption
impl UnwindSafe for PkEncryption
Blanket Implementations§
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
§impl<T> CompatExt for T
impl<T> CompatExt for T
Source§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
Source§fn consume_handle(handle: Handle) -> Arc<T>
fn consume_handle(handle: Handle) -> Arc<T>
Consume a handle, getting back the initial
Arc<>
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more