Struct iop_keyvault_wasm::JsSecpPrivateKey
source · [−]pub struct JsSecpPrivateKey { /* private fields */ }
Expand description
Secp256k1 private key
Implementations
sourceimpl JsSecpPrivateKey
impl JsSecpPrivateKey
sourcepub fn from_ark_passphrase(phrase: &str) -> Result<JsSecpPrivateKey, JsValue>
pub fn from_ark_passphrase(phrase: &str) -> Result<JsSecpPrivateKey, JsValue>
Creates a {@link SecpPrivateKey} from a passphrase compatible with ark.io wallets.
An Ark passphrase is a secret that must not be kept unencrypted in transit or in rest!
sourcepub fn from_wif(wif: &str, network: &str) -> Result<JsSecpPrivateKey, JsValue>
pub fn from_wif(wif: &str, network: &str) -> Result<JsSecpPrivateKey, JsValue>
Creates a {@link SecpPrivateKey} from a WIF string compatible with BTC-related wallets. The second argument is a network name, that {@link validateNetworkName} accepts.
A WIF is a secret that must not be kept unencrypted in transit or in rest!
sourcepub fn to_wif(&self, network: &str) -> Result<String, JsValue>
pub fn to_wif(&self, network: &str) -> Result<String, JsValue>
Creates a WIF string compatible with BTC-related wallets. The second argument is a network name, that {@link validateNetworkName} accepts.
This is a secret that must not be kept unencrypted in transit or in rest!
sourcepub fn public_key(&self) -> JsSecpPublicKey
pub fn public_key(&self) -> JsSecpPublicKey
Calculates the public key the belongs to this private key.
sourcepub fn sign_ecdsa(&self, data: &[u8]) -> JsSecpSignature
pub fn sign_ecdsa(&self, data: &[u8]) -> JsSecpSignature
Calculates the signature of a message that can be then verified using {@link SecpPublicKey.validate_ecdsa}
Trait Implementations
sourceimpl Clone for JsSecpPrivateKey
impl Clone for JsSecpPrivateKey
sourcefn clone(&self) -> JsSecpPrivateKey
fn clone(&self) -> JsSecpPrivateKey
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<JsSecpPrivateKey> for JsValue
impl From<JsSecpPrivateKey> for JsValue
sourcefn from(value: JsSecpPrivateKey) -> Self
fn from(value: JsSecpPrivateKey) -> Self
Converts to this type from the input type.
sourceimpl From<SecpPrivateKey> for JsSecpPrivateKey
impl From<SecpPrivateKey> for JsSecpPrivateKey
sourcefn from(inner: SecpPrivateKey) -> Self
fn from(inner: SecpPrivateKey) -> Self
Converts to this type from the input type.
sourceimpl FromWasmAbi for JsSecpPrivateKey
impl FromWasmAbi for JsSecpPrivateKey
sourceimpl IntoWasmAbi for JsSecpPrivateKey
impl IntoWasmAbi for JsSecpPrivateKey
sourceimpl OptionFromWasmAbi for JsSecpPrivateKey
impl OptionFromWasmAbi for JsSecpPrivateKey
sourceimpl OptionIntoWasmAbi for JsSecpPrivateKey
impl OptionIntoWasmAbi for JsSecpPrivateKey
sourceimpl RefFromWasmAbi for JsSecpPrivateKey
impl RefFromWasmAbi for JsSecpPrivateKey
type Anchor = Ref<'static, JsSecpPrivateKey>
type Anchor = Ref<'static, JsSecpPrivateKey>
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 JsSecpPrivateKey
impl RefMutFromWasmAbi for JsSecpPrivateKey
type Anchor = RefMut<'static, JsSecpPrivateKey>
type Anchor = RefMut<'static, JsSecpPrivateKey>
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 JsSecpPrivateKey
impl WasmDescribe for JsSecpPrivateKey
sourceimpl Wraps<SecpPrivateKey> for JsSecpPrivateKey
impl Wraps<SecpPrivateKey> for JsSecpPrivateKey
sourcefn inner(&self) -> &SecpPrivateKey
fn inner(&self) -> &SecpPrivateKey
Converts a reference to a WASM type to a reference to the underlying Rust type.
Auto Trait Implementations
impl RefUnwindSafe for JsSecpPrivateKey
impl Send for JsSecpPrivateKey
impl Sync for JsSecpPrivateKey
impl Unpin for JsSecpPrivateKey
impl UnwindSafe for JsSecpPrivateKey
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