pub struct PublicKey(pub PublicKey<Ed25519>);
Expand description
ED25519 key used as public key
Tuple Fields§
§0: PublicKey<Ed25519>
Implementations§
Source§impl PublicKey
impl PublicKey
Sourcepub fn from_bech32(bech32_str: &str) -> Result<PublicKey, CryptoError>
pub fn from_bech32(bech32_str: &str) -> Result<PublicKey, CryptoError>
Get public key from its bech32 representation Example:
use cml_crypto::PublicKey;
let key = PublicKey::from_bech32("ed25519_pk1dgaagyh470y66p899txcl3r0jaeaxu6yd7z2dxyk55qcycdml8gszkxze2").unwrap();
pub fn to_bech32(&self) -> String
pub fn verify(&self, data: &[u8], signature: &Ed25519Signature) -> bool
pub fn hash(&self) -> Ed25519KeyHash
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 schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &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 moreSource§impl RawBytesEncoding for PublicKey
impl RawBytesEncoding for PublicKey
fn to_raw_bytes(&self) -> &[u8] ⓘ
fn from_raw_bytes(bytes: &[u8]) -> Result<Self, DeserializeError>
fn to_raw_hex(&self) -> String
fn from_raw_hex(hex_str: &str) -> Result<Self, DeserializeError>where
Self: Sized,
impl Eq for PublicKey
impl StructuralPartialEq for PublicKey
Auto Trait Implementations§
impl Freeze for PublicKey
impl RefUnwindSafe for PublicKey
impl Send for PublicKey
impl Sync for PublicKey
impl Unpin for PublicKey
impl UnwindSafe for PublicKey
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