Struct iop_keyvault_wasm::JsMPrivateKey
source · [−]pub struct JsMPrivateKey { /* private fields */ }
Expand description
Multicipher private key
A private key (also called secret key or sk in some literature) is the part of an asymmetric keypair which is never shared with anyone. It is used to sign a message sent to any recipient or to decrypt a message that was sent encrypted from any recipients.
In general it is discouraged to serialize and transfer secrets over a network, so you might be missing some of those methods. The exception to this rule for compatibility is to support for deserializing WIF strings usual in BTC wallets.
Implementations
sourceimpl JsMPrivateKey
impl JsMPrivateKey
sourcepub fn from_secp(sk: &JsSecpPrivateKey) -> Self
pub fn from_secp(sk: &JsSecpPrivateKey) -> Self
Converts a {@link SecpPrivateKey} into a multicipher {@link PrivateKey}.
sourcepub fn public_key(&self) -> JsMPublicKey
pub fn public_key(&self) -> JsMPublicKey
Calculates the public key the belongs to this private key.
sourcepub fn sign_ecdsa(&self, data: &[u8]) -> JsMSignature
pub fn sign_ecdsa(&self, data: &[u8]) -> JsMSignature
Calculates the signature of a message that can be then verified using {@link PublicKey.validate_ecdsa}
Trait Implementations
sourceimpl Clone for JsMPrivateKey
impl Clone for JsMPrivateKey
sourcefn clone(&self) -> JsMPrivateKey
fn clone(&self) -> JsMPrivateKey
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl From<JsMPrivateKey> for JsValue
impl From<JsMPrivateKey> for JsValue
sourcefn from(value: JsMPrivateKey) -> Self
fn from(value: JsMPrivateKey) -> Self
Converts to this type from the input type.
sourceimpl From<MPrivateKey> for JsMPrivateKey
impl From<MPrivateKey> for JsMPrivateKey
sourcefn from(inner: MPrivateKey) -> Self
fn from(inner: MPrivateKey) -> Self
Converts to this type from the input type.
sourceimpl FromWasmAbi for JsMPrivateKey
impl FromWasmAbi for JsMPrivateKey
sourceimpl IntoWasmAbi for JsMPrivateKey
impl IntoWasmAbi for JsMPrivateKey
sourceimpl OptionFromWasmAbi for JsMPrivateKey
impl OptionFromWasmAbi for JsMPrivateKey
sourceimpl OptionIntoWasmAbi for JsMPrivateKey
impl OptionIntoWasmAbi for JsMPrivateKey
sourceimpl RefFromWasmAbi for JsMPrivateKey
impl RefFromWasmAbi for JsMPrivateKey
type Anchor = Ref<'static, JsMPrivateKey>
type Anchor = Ref<'static, JsMPrivateKey>
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. Read more
sourceunsafe fn ref_from_abi(js: Self::Abi) -> Self::Anchor
unsafe fn ref_from_abi(js: Self::Abi) -> Self::Anchor
Recover a Self::Anchor
from Self::Abi
. Read more
sourceimpl RefMutFromWasmAbi for JsMPrivateKey
impl RefMutFromWasmAbi for JsMPrivateKey
type Anchor = RefMut<'static, JsMPrivateKey>
type Anchor = RefMut<'static, JsMPrivateKey>
Same as RefFromWasmAbi::Anchor
sourceunsafe 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_abi
sourceimpl WasmDescribe for JsMPrivateKey
impl WasmDescribe for JsMPrivateKey
sourceimpl Wraps<MPrivateKey> for JsMPrivateKey
impl Wraps<MPrivateKey> for JsMPrivateKey
sourcefn inner(&self) -> &MPrivateKey
fn inner(&self) -> &MPrivateKey
Converts a reference to a WASM type to a reference to the underlying Rust type.
Auto Trait Implementations
impl RefUnwindSafe for JsMPrivateKey
impl Send for JsMPrivateKey
impl Sync for JsMPrivateKey
impl Unpin for JsMPrivateKey
impl UnwindSafe for JsMPrivateKey
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ReturnWasmAbi for T where
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for T where
T: IntoWasmAbi,
type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as IntoWasmAbi::Abi
sourcefn 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
. Read more