Struct cardano_serialization_lib::crypto::PrivateKey
source · [−]pub struct PrivateKey(_);
Implementations
sourceimpl PrivateKey
impl PrivateKey
pub fn to_public(&self) -> PublicKey
pub fn generate_ed25519() -> Result<PrivateKey, JsError>
pub fn generate_ed25519extended() -> Result<PrivateKey, JsError>
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 as_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
sourceimpl From<EitherEd25519SecretKey> for PrivateKey
impl From<EitherEd25519SecretKey> for PrivateKey
sourcefn from(secret_key: EitherEd25519SecretKey) -> PrivateKey
fn from(secret_key: EitherEd25519SecretKey) -> PrivateKey
Performs the conversion.
Auto Trait Implementations
impl RefUnwindSafe for PrivateKey
impl Send for PrivateKey
impl Sync for PrivateKey
impl Unpin for PrivateKey
impl UnwindSafe for PrivateKey
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more