pub struct PureCrypto {}
Expand description
This module represents a stopgap solution to provide access to primitive crypto functions for JS clients. It is not intended to be used outside of the JS clients and this pattern should not be proliferated. It is necessary because we want to use SDK crypto prior to the SDK being fully responsible for state and keys.
Implementations§
Source§impl PureCrypto
impl PureCrypto
pub fn symmetric_decrypt( enc_string: String, key_b64: String, ) -> Result<String, CryptoError>
pub fn symmetric_decrypt_to_bytes( enc_string: String, key_b64: String, ) -> Result<Vec<u8>, CryptoError>
pub fn symmetric_decrypt_array_buffer( enc_bytes: Vec<u8>, key_b64: String, ) -> Result<Vec<u8>, CryptoError>
pub fn symmetric_encrypt( plain: String, key_b64: String, ) -> Result<String, CryptoError>
pub fn symmetric_encrypt_to_array_buffer( plain: Vec<u8>, key_b64: String, ) -> Result<Vec<u8>, CryptoError>
Trait Implementations§
Source§impl From<PureCrypto> for JsValue
impl From<PureCrypto> for JsValue
Source§fn from(value: PureCrypto) -> Self
fn from(value: PureCrypto) -> Self
Converts to this type from the input type.
Source§impl FromWasmAbi for PureCrypto
impl FromWasmAbi for PureCrypto
Source§impl IntoWasmAbi for PureCrypto
impl IntoWasmAbi for PureCrypto
Source§impl LongRefFromWasmAbi for PureCrypto
impl LongRefFromWasmAbi for PureCrypto
Source§impl OptionFromWasmAbi for PureCrypto
impl OptionFromWasmAbi for PureCrypto
Source§impl OptionIntoWasmAbi for PureCrypto
impl OptionIntoWasmAbi for PureCrypto
Source§impl RefFromWasmAbi for PureCrypto
impl RefFromWasmAbi for PureCrypto
Source§type Anchor = RcRef<PureCrypto>
type Anchor = RcRef<PureCrypto>
The type that holds the reference to
Self
for the duration of the
invocation of the function that has an &Self
parameter. This is
required to ensure that the lifetimes don’t persist beyond one function
call, and so that they remain anonymous.Source§impl RefMutFromWasmAbi for PureCrypto
impl RefMutFromWasmAbi for PureCrypto
Source§impl TryFromJsValue for PureCrypto
impl TryFromJsValue for PureCrypto
Source§impl VectorFromWasmAbi for PureCrypto
impl VectorFromWasmAbi for PureCrypto
type Abi = <Box<[JsValue]> as FromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[PureCrypto]>
Source§impl VectorIntoJsValue for PureCrypto
impl VectorIntoJsValue for PureCrypto
fn vector_into_jsvalue(vector: Box<[PureCrypto]>) -> JsValue
Source§impl VectorIntoWasmAbi for PureCrypto
impl VectorIntoWasmAbi for PureCrypto
type Abi = <Box<[JsValue]> as IntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[PureCrypto]>) -> Self::Abi
Source§impl WasmDescribe for PureCrypto
impl WasmDescribe for PureCrypto
Source§impl WasmDescribeVector for PureCrypto
impl WasmDescribeVector for PureCrypto
impl SupportsConstructor for PureCrypto
impl SupportsInstanceProperty for PureCrypto
impl SupportsStaticProperty for PureCrypto
Auto Trait Implementations§
impl Freeze for PureCrypto
impl RefUnwindSafe for PureCrypto
impl Send for PureCrypto
impl Sync for PureCrypto
impl Unpin for PureCrypto
impl UnwindSafe for PureCrypto
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
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
Create a new handle for an Arc value Read more
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
Clone a handle Read more
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Consume a handle, getting back the initial
Arc<>
Read more§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§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as
IntoWasmAbi::Abi
Source§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as
IntoWasmAbi::into_abi
, except that it may throw and never
return in the case of Err
.