pub struct KemKeypair {
pub public_key: KemPublicKey,
pub secret_key: KemSecretKey,
}Expand description
KEM keypair with automatic memory zeroization
Fields§
§public_key: KemPublicKey§secret_key: KemSecretKeyImplementations§
Source§impl KemKeypair
impl KemKeypair
pub fn new(public_key: Vec<u8>, secret_key: Vec<u8>) -> Self
pub fn public_key(&self) -> &KemPublicKey
pub fn secret_key(&self) -> &KemSecretKey
Source§impl KemKeypair
impl KemKeypair
Sourcepub fn new_wasm(public_key: Vec<u8>, secret_key: Vec<u8>) -> KemKeypair
pub fn new_wasm(public_key: Vec<u8>, secret_key: Vec<u8>) -> KemKeypair
Create a new KEM keypair from bytes for WASM
Sourcepub fn public_key_bytes(&self) -> Vec<u8> ⓘ
pub fn public_key_bytes(&self) -> Vec<u8> ⓘ
Get the public key as bytes for WASM
Sourcepub fn secret_key_bytes(&self) -> Uint8Array
pub fn secret_key_bytes(&self) -> Uint8Array
Copy the secret key into a new Uint8Array for WASM (avoids returning an owned non-zeroizing Vec<u8>).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for KemKeypair
impl<'de> Deserialize<'de> for KemKeypair
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<KemKeypair> for JsValue
impl From<KemKeypair> for JsValue
Source§fn from(value: KemKeypair) -> Self
fn from(value: KemKeypair) -> Self
Converts to this type from the input type.
Source§impl FromWasmAbi for KemKeypair
impl FromWasmAbi for KemKeypair
Source§impl IntoWasmAbi for KemKeypair
impl IntoWasmAbi for KemKeypair
Source§impl LongRefFromWasmAbi for KemKeypair
impl LongRefFromWasmAbi for KemKeypair
Source§type Abi = WasmPtr<WasmRefCell<KemKeypair>>
type Abi = WasmPtr<WasmRefCell<KemKeypair>>
Same as
RefFromWasmAbi::AbiSource§type Anchor = RcRef<KemKeypair>
type Anchor = RcRef<KemKeypair>
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 KemKeypair
impl OptionFromWasmAbi for KemKeypair
Source§impl OptionIntoWasmAbi for KemKeypair
impl OptionIntoWasmAbi for KemKeypair
Source§impl RefFromWasmAbi for KemKeypair
impl RefFromWasmAbi for KemKeypair
Source§type Abi = WasmPtr<WasmRefCell<KemKeypair>>
type Abi = WasmPtr<WasmRefCell<KemKeypair>>
The Wasm ABI type references to
Self are recovered from.Source§type Anchor = RcRef<KemKeypair>
type Anchor = RcRef<KemKeypair>
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 KemKeypair
impl RefMutFromWasmAbi for KemKeypair
Source§type Abi = WasmPtr<WasmRefCell<KemKeypair>>
type Abi = WasmPtr<WasmRefCell<KemKeypair>>
Same as
RefFromWasmAbi::AbiSource§type Anchor = RcRefMut<KemKeypair>
type Anchor = RcRefMut<KemKeypair>
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 Serialize for KemKeypair
impl Serialize for KemKeypair
Source§impl TryFromJsValue for KemKeypair
impl TryFromJsValue for KemKeypair
Source§impl VectorFromWasmAbi for KemKeypair
impl VectorFromWasmAbi for KemKeypair
type Abi = <Box<[JsValue]> as FromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[KemKeypair]>
Source§impl VectorIntoWasmAbi for KemKeypair
impl VectorIntoWasmAbi for KemKeypair
type Abi = <Box<[JsValue]> as IntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[KemKeypair]>) -> Self::Abi
Source§impl WasmDescribeVector for KemKeypair
impl WasmDescribeVector for KemKeypair
impl SupportsConstructor for KemKeypair
impl SupportsInstanceProperty for KemKeypair
impl SupportsStaticProperty for KemKeypair
Auto Trait Implementations§
impl Freeze for KemKeypair
impl RefUnwindSafe for KemKeypair
impl Send for KemKeypair
impl Sync for KemKeypair
impl Unpin for KemKeypair
impl UnsafeUnpin for KemKeypair
impl UnwindSafe for KemKeypair
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.