Struct cardano_serialization_lib::crypto::PublicKey
source · [−]pub struct PublicKey(_);
Expand description
ED25519 key used as public key
Implementations
sourceimpl 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
sourceimpl<'de> Deserialize<'de> for PublicKey
impl<'de> Deserialize<'de> for PublicKey
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 JsonSchema for PublicKey
impl JsonSchema for PublicKey
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
impl Eq for PublicKey
impl StructuralEq for PublicKey
impl StructuralPartialEq for PublicKey
Auto Trait Implementations
impl RefUnwindSafe for PublicKey
impl Send for PublicKey
impl Sync for PublicKey
impl Unpin for PublicKey
impl UnwindSafe for PublicKey
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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