pub struct PrivateKey(/* private fields */);Implementations§
Source§impl PrivateKey
impl PrivateKey
pub fn to_public(&self) -> PublicKey
pub fn generate_ed25519() -> Self
pub fn generate_ed25519extended() -> Self
Sourcepub fn from_bech32(bech32_str: &str) -> Result<PrivateKey, JsError>
pub fn from_bech32(bech32_str: &str) -> Result<PrivateKey, JsError>
Get private key from its bech32 representation
PrivateKey.from_bech32('ed25519_sk1ahfetf02qwwg4dkq7mgp4a25lx5vh9920cr5wnxmpzz9906qvm8qwvlts0');For an extended 25519 key
PrivateKey.from_bech32('ed25519e_sk1gqwl4szuwwh6d0yk3nsqcc6xxc3fpvjlevgwvt60df59v8zd8f8prazt8ln3lmz096ux3xvhhvm3ca9wj2yctdh3pnw0szrma07rt5gl748fp');pub fn to_bech32(&self) -> String
pub fn to_raw_bytes(&self) -> Vec<u8> ⓘ
pub fn from_extended_bytes(bytes: &[u8]) -> Result<PrivateKey, JsError>
pub fn from_normal_bytes(bytes: &[u8]) -> Result<PrivateKey, JsError>
pub fn sign(&self, message: &[u8]) -> Ed25519Signature
Trait Implementations§
Source§impl AsRef<PrivateKey> for PrivateKey
impl AsRef<PrivateKey> for PrivateKey
Source§fn as_ref(&self) -> &PrivateKey
fn as_ref(&self) -> &PrivateKey
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl From<PrivateKey> for JsValue
impl From<PrivateKey> for JsValue
Source§fn from(value: PrivateKey) -> Self
fn from(value: PrivateKey) -> Self
Converts to this type from the input type.
Source§impl From<PrivateKey> for PrivateKey
impl From<PrivateKey> for PrivateKey
Source§fn from(inner: PrivateKey) -> Self
fn from(inner: PrivateKey) -> Self
Converts to this type from the input type.
Source§impl From<PrivateKey> for PrivateKey
impl From<PrivateKey> for PrivateKey
Source§fn from(wrapper: PrivateKey) -> Self
fn from(wrapper: PrivateKey) -> Self
Converts to this type from the input type.
Source§impl FromWasmAbi for PrivateKey
impl FromWasmAbi for PrivateKey
Source§impl IntoWasmAbi for PrivateKey
impl IntoWasmAbi for PrivateKey
Source§impl LongRefFromWasmAbi for PrivateKey
impl LongRefFromWasmAbi for PrivateKey
Source§impl OptionFromWasmAbi for PrivateKey
impl OptionFromWasmAbi for PrivateKey
Source§impl OptionIntoWasmAbi for PrivateKey
impl OptionIntoWasmAbi for PrivateKey
Source§impl RefFromWasmAbi for PrivateKey
impl RefFromWasmAbi for PrivateKey
Source§type Anchor = RcRef<PrivateKey>
type Anchor = RcRef<PrivateKey>
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 PrivateKey
impl RefMutFromWasmAbi for PrivateKey
Source§impl TryFromJsValue for PrivateKey
impl TryFromJsValue for PrivateKey
Source§impl VectorFromWasmAbi for PrivateKey
impl VectorFromWasmAbi for PrivateKey
type Abi = <Box<[JsValue]> as FromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[PrivateKey]>
Source§impl VectorIntoJsValue for PrivateKey
impl VectorIntoJsValue for PrivateKey
fn vector_into_jsvalue(vector: Box<[PrivateKey]>) -> JsValue
Source§impl VectorIntoWasmAbi for PrivateKey
impl VectorIntoWasmAbi for PrivateKey
type Abi = <Box<[JsValue]> as IntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[PrivateKey]>) -> Self::Abi
Source§impl WasmDescribeVector for PrivateKey
impl WasmDescribeVector for PrivateKey
impl SupportsConstructor for PrivateKey
impl SupportsInstanceProperty for PrivateKey
impl SupportsStaticProperty for PrivateKey
Auto Trait Implementations§
impl Freeze for PrivateKey
impl RefUnwindSafe for PrivateKey
impl Send for PrivateKey
impl Sync for PrivateKey
impl Unpin for PrivateKey
impl UnwindSafe for PrivateKey
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.