pub struct PublicKey(/* private fields */);
Expand description
ED25519 key used as public key
Implementations§
Source§impl PublicKey
impl PublicKey
Sourcepub fn from_bech32(bech32_str: &str) -> Result<PublicKey, JsError>
pub fn from_bech32(bech32_str: &str) -> Result<PublicKey, JsError>
Get public key from its bech32 representation Example:
const pkey = PublicKey.from_bech32('ed25519_pk1dgaagyh470y66p899txcl3r0jaeaxu6yd7z2dxyk55qcycdml8gszkxze2');
pub fn to_bech32(&self) -> String
pub fn to_raw_bytes(&self) -> Vec<u8> ⓘ
pub fn from_bytes(bytes: &[u8]) -> Result<PublicKey, JsError>
pub fn verify(&self, data: &[u8], signature: &Ed25519Signature) -> bool
pub fn hash(&self) -> Ed25519KeyHash
Trait Implementations§
Source§impl FromWasmAbi for PublicKey
impl FromWasmAbi for PublicKey
Source§impl IntoWasmAbi for PublicKey
impl IntoWasmAbi for PublicKey
Source§impl LongRefFromWasmAbi for PublicKey
impl LongRefFromWasmAbi for PublicKey
Source§impl OptionFromWasmAbi for PublicKey
impl OptionFromWasmAbi for PublicKey
Source§impl OptionIntoWasmAbi for PublicKey
impl OptionIntoWasmAbi for PublicKey
Source§impl RefFromWasmAbi for PublicKey
impl RefFromWasmAbi for PublicKey
Source§impl RefMutFromWasmAbi for PublicKey
impl RefMutFromWasmAbi for PublicKey
Source§impl TryFromJsValue for PublicKey
impl TryFromJsValue for PublicKey
Source§impl VectorFromWasmAbi for PublicKey
impl VectorFromWasmAbi for PublicKey
Source§impl VectorIntoWasmAbi for PublicKey
impl VectorIntoWasmAbi for PublicKey
impl SupportsConstructor for PublicKey
impl SupportsInstanceProperty for PublicKey
impl SupportsStaticProperty for PublicKey
Auto Trait Implementations§
impl Freeze for PublicKey
impl RefUnwindSafe for PublicKey
impl Send for PublicKey
impl Sync for PublicKey
impl Unpin for PublicKey
impl UnwindSafe for PublicKey
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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::Abi
Source§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
.