Struct cardano_multiplatform_lib::crypto::Bip32PublicKey
source · [−]pub struct Bip32PublicKey(_);
Implementations
sourceimpl Bip32PublicKey
impl Bip32PublicKey
sourcepub fn derive(&self, index: u32) -> Result<Bip32PublicKey, JsError>
pub fn derive(&self, index: u32) -> Result<Bip32PublicKey, JsError>
derive this public key with the given index.
Errors
If the index is not a soft derivation index (< 0x80000000) then calling this method will fail.
Security considerations
- hard derivation index cannot be soft derived with the public key
Hard derivation vs Soft derivation
If you pass an index below 0x80000000 then it is a soft derivation. The advantage of soft derivation is that it is possible to derive the public key too. I.e. derivation the private key with a soft derivation index and then retrieving the associated public key is equivalent to deriving the public key associated to the parent private key.
Hard derivation index does not allow public key derivation.
This is why deriving the private key should not fail while deriving the public key may fail (if the derivation index is invalid).
pub fn to_raw_key(&self) -> PublicKey
pub fn from_bytes(bytes: &[u8]) -> Result<Bip32PublicKey, JsError>
pub fn as_bytes(&self) -> Vec<u8>
pub fn from_bech32(bech32_str: &str) -> Result<Bip32PublicKey, JsError>
pub fn to_bech32(&self) -> String
pub fn chaincode(&self) -> Vec<u8>
Trait Implementations
sourceimpl Clone for Bip32PublicKey
impl Clone for Bip32PublicKey
sourcefn clone(&self) -> Bip32PublicKey
fn clone(&self) -> Bip32PublicKey
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 Bip32PublicKey
impl Debug for Bip32PublicKey
sourceimpl<'de> Deserialize<'de> for Bip32PublicKey
impl<'de> Deserialize<'de> for Bip32PublicKey
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Hash for Bip32PublicKey
impl Hash for Bip32PublicKey
sourceimpl JsonSchema for Bip32PublicKey
impl JsonSchema for Bip32PublicKey
sourcefn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
sourcefn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
sourcefn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the $ref
keyword. Read more
sourceimpl PartialEq<Bip32PublicKey> for Bip32PublicKey
impl PartialEq<Bip32PublicKey> for Bip32PublicKey
sourcefn eq(&self, other: &Bip32PublicKey) -> bool
fn eq(&self, other: &Bip32PublicKey) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourceimpl Serialize for Bip32PublicKey
impl Serialize for Bip32PublicKey
impl Eq for Bip32PublicKey
impl StructuralEq for Bip32PublicKey
impl StructuralPartialEq for Bip32PublicKey
Auto Trait Implementations
impl RefUnwindSafe for Bip32PublicKey
impl Send for Bip32PublicKey
impl Sync for Bip32PublicKey
impl Unpin for Bip32PublicKey
impl UnwindSafe for Bip32PublicKey
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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