Struct iop_keyvault_wasm::JsSecpPublicKey
source · [−]pub struct JsSecpPublicKey { /* private fields */ }
Expand description
Secp256k1 public key
Implementations
sourceimpl JsSecpPublicKey
impl JsSecpPublicKey
sourcepub fn new(key: &str) -> Result<JsSecpPublicKey, JsValue>
pub fn new(key: &str) -> Result<JsSecpPublicKey, JsValue>
Parses a string into a {@link SecpPublicKey}.
sourcepub fn key_id(&self) -> JsSecpKeyId
pub fn key_id(&self) -> JsSecpKeyId
Calculates the key id (also called fingerprint or address in some literature) of the public key.
sourcepub fn ark_key_id(&self) -> JsSecpKeyId
pub fn ark_key_id(&self) -> JsSecpKeyId
Calculates the key id of the public key the non-standard way ark.io and therefore Hydra uses.
Regular bitcoin-based chains use the ripemd160 hash of the sha2-256 hash of the public key, but ARK only uses ripemd160.
sourcepub fn validate_id(&self, key_id: &JsSecpKeyId) -> bool
pub fn validate_id(&self, key_id: &JsSecpKeyId) -> bool
Validates if key_id
belongs to this public key
sourcepub fn validate_ark_id(&self, key_id: &JsSecpKeyId) -> bool
pub fn validate_ark_id(&self, key_id: &JsSecpKeyId) -> bool
Validates if key_id
belongs to this public key if it was generated
the ark.io way.
sourcepub fn validate_ecdsa(&self, data: &[u8], signature: &JsSecpSignature) -> bool
pub fn validate_ecdsa(&self, data: &[u8], signature: &JsSecpSignature) -> bool
This method can be used to verify if a given signature for a message was made using the private key that belongs to this public key.
Trait Implementations
sourceimpl Clone for JsSecpPublicKey
impl Clone for JsSecpPublicKey
sourcefn clone(&self) -> JsSecpPublicKey
fn clone(&self) -> JsSecpPublicKey
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 Debug for JsSecpPublicKey
impl Debug for JsSecpPublicKey
sourceimpl From<JsSecpPublicKey> for JsValue
impl From<JsSecpPublicKey> for JsValue
sourcefn from(value: JsSecpPublicKey) -> Self
fn from(value: JsSecpPublicKey) -> Self
Converts to this type from the input type.
sourceimpl From<SecpPublicKey> for JsSecpPublicKey
impl From<SecpPublicKey> for JsSecpPublicKey
sourcefn from(inner: SecpPublicKey) -> Self
fn from(inner: SecpPublicKey) -> Self
Converts to this type from the input type.
sourceimpl FromWasmAbi for JsSecpPublicKey
impl FromWasmAbi for JsSecpPublicKey
sourceimpl IntoWasmAbi for JsSecpPublicKey
impl IntoWasmAbi for JsSecpPublicKey
sourceimpl OptionFromWasmAbi for JsSecpPublicKey
impl OptionFromWasmAbi for JsSecpPublicKey
sourceimpl OptionIntoWasmAbi for JsSecpPublicKey
impl OptionIntoWasmAbi for JsSecpPublicKey
sourceimpl RefFromWasmAbi for JsSecpPublicKey
impl RefFromWasmAbi for JsSecpPublicKey
type Anchor = Ref<'static, JsSecpPublicKey>
type Anchor = Ref<'static, JsSecpPublicKey>
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 JsSecpPublicKey
impl RefMutFromWasmAbi for JsSecpPublicKey
type Anchor = RefMut<'static, JsSecpPublicKey>
type Anchor = RefMut<'static, JsSecpPublicKey>
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 JsSecpPublicKey
impl WasmDescribe for JsSecpPublicKey
sourceimpl Wraps<SecpPublicKey> for JsSecpPublicKey
impl Wraps<SecpPublicKey> for JsSecpPublicKey
sourcefn inner(&self) -> &SecpPublicKey
fn inner(&self) -> &SecpPublicKey
Converts a reference to a WASM type to a reference to the underlying Rust type.
Auto Trait Implementations
impl RefUnwindSafe for JsSecpPublicKey
impl Send for JsSecpPublicKey
impl Sync for JsSecpPublicKey
impl Unpin for JsSecpPublicKey
impl UnwindSafe for JsSecpPublicKey
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