pub struct VaultCrypto;Expand description
Crypto utilities for the Identity Vault
Implementations§
Source§impl VaultCrypto
impl VaultCrypto
Sourcepub fn encrypt_vault(data: &[u8], password: &str) -> Result<Vec<u8>, JsValue>
pub fn encrypt_vault(data: &[u8], password: &str) -> Result<Vec<u8>, JsValue>
Encrypts data using XChaCha20Poly1305 with a key derived from Argon2id Output format: [MAGIC_BYTES (13)] [SALT (16)] [NONCE (24)] [CIPHERTEXT]
Trait Implementations§
Source§impl From<VaultCrypto> for JsValue
impl From<VaultCrypto> for JsValue
Source§fn from(value: VaultCrypto) -> Self
fn from(value: VaultCrypto) -> Self
Converts to this type from the input type.
Source§impl FromWasmAbi for VaultCrypto
impl FromWasmAbi for VaultCrypto
Source§impl IntoWasmAbi for VaultCrypto
impl IntoWasmAbi for VaultCrypto
Source§impl LongRefFromWasmAbi for VaultCrypto
impl LongRefFromWasmAbi for VaultCrypto
Source§type Abi = WasmPtr<WasmRefCell<VaultCrypto>>
type Abi = WasmPtr<WasmRefCell<VaultCrypto>>
Same as
RefFromWasmAbi::AbiSource§type Anchor = RcRef<VaultCrypto>
type Anchor = RcRef<VaultCrypto>
Same as
RefFromWasmAbi::AnchorSource§unsafe fn long_ref_from_abi(js: Self::Abi) -> Self::Anchor
unsafe fn long_ref_from_abi(js: Self::Abi) -> Self::Anchor
Same as
RefFromWasmAbi::ref_from_abiSource§impl OptionFromWasmAbi for VaultCrypto
impl OptionFromWasmAbi for VaultCrypto
Source§impl OptionIntoWasmAbi for VaultCrypto
impl OptionIntoWasmAbi for VaultCrypto
Source§impl RefFromWasmAbi for VaultCrypto
impl RefFromWasmAbi for VaultCrypto
Source§type Abi = WasmPtr<WasmRefCell<VaultCrypto>>
type Abi = WasmPtr<WasmRefCell<VaultCrypto>>
The Wasm ABI type references to
Self are recovered from.Source§type Anchor = RcRef<VaultCrypto>
type Anchor = RcRef<VaultCrypto>
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 VaultCrypto
impl RefMutFromWasmAbi for VaultCrypto
Source§type Abi = WasmPtr<WasmRefCell<VaultCrypto>>
type Abi = WasmPtr<WasmRefCell<VaultCrypto>>
Same as
RefFromWasmAbi::AbiSource§type Anchor = RcRefMut<VaultCrypto>
type Anchor = RcRefMut<VaultCrypto>
Same as
RefFromWasmAbi::AnchorSource§unsafe fn ref_mut_from_abi(js: Self::Abi) -> Self::Anchor
unsafe fn ref_mut_from_abi(js: Self::Abi) -> Self::Anchor
Same as
RefFromWasmAbi::ref_from_abiSource§impl TryFromJsValue for VaultCrypto
impl TryFromJsValue for VaultCrypto
Source§impl VectorFromWasmAbi for VaultCrypto
impl VectorFromWasmAbi for VaultCrypto
type Abi = <Box<[JsValue]> as FromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[VaultCrypto]>
Source§impl VectorIntoWasmAbi for VaultCrypto
impl VectorIntoWasmAbi for VaultCrypto
type Abi = <Box<[JsValue]> as IntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[VaultCrypto]>) -> Self::Abi
Source§impl WasmDescribeVector for VaultCrypto
impl WasmDescribeVector for VaultCrypto
impl SupportsConstructor for VaultCrypto
impl SupportsInstanceProperty for VaultCrypto
impl SupportsStaticProperty for VaultCrypto
Auto Trait Implementations§
impl Freeze for VaultCrypto
impl RefUnwindSafe for VaultCrypto
impl Send for VaultCrypto
impl Sync for VaultCrypto
impl Unpin for VaultCrypto
impl UnsafeUnpin for VaultCrypto
impl UnwindSafe for VaultCrypto
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
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::AbiSource§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.