Struct cardano_serialization_lib::crypto::PublicKey
source · pub struct PublicKey(_);
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 as_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
pub fn to_hex(&self) -> String
pub fn from_hex(hex_str: &str) -> Result<PublicKey, JsError>
Trait Implementations§
source§impl<'de> Deserialize<'de> for PublicKey
impl<'de> Deserialize<'de> for PublicKey
source§fn 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
source§impl JsonSchema for PublicKey
impl JsonSchema for PublicKey
source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
source§fn 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