pub struct PublicKey(/* private fields */);Expand description
A verification key: the public half of a SigningKey. Key ids are
content addresses of this key (derive_key_id), so a key id on a
receipt commits to exactly one key.
Implementations§
Source§impl PublicKey
impl PublicKey
Sourcepub fn from_bytes(bytes: &[u8; 32]) -> Result<Self, RustyError>
pub fn from_bytes(bytes: &[u8; 32]) -> Result<Self, RustyError>
Wrap 32 bytes of public key material. Fails on bytes that are not a valid compressed Edwards point — a malformed key is rejected here, not at first verification.
Sourcepub fn from_hex(hex: &str) -> Result<Self, RustyError>
pub fn from_hex(hex: &str) -> Result<Self, RustyError>
Rehydrate from the hex form (PublicKey::to_hex). None on
malformed hex or wrong length; an invalid point is an error.
Sourcepub fn to_hex(&self) -> String
pub fn to_hex(&self) -> String
Lowercase hex of the public bytes — the form the key history holds.
Sourcepub fn key_id(&self) -> String
pub fn key_id(&self) -> String
This key’s content-addressed id (derive_key_id).
Trait Implementations§
impl Copy for PublicKey
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 UnsafeUnpin 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