Struct libp2p_identity::ed25519::PublicKey
source · pub struct PublicKey(/* private fields */);
Expand description
An Ed25519 public key.
Implementations§
source§impl PublicKey
impl PublicKey
sourcepub fn verify(&self, msg: &[u8], sig: &[u8]) -> bool
pub fn verify(&self, msg: &[u8], sig: &[u8]) -> bool
Verify the Ed25519 signature on a message using the public key.
sourcepub fn to_bytes(&self) -> [u8; 32]
pub fn to_bytes(&self) -> [u8; 32]
Convert the public key to a byte array in compressed form, i.e. where one coordinate is represented by a single bit.
sourcepub fn try_from_bytes(k: &[u8]) -> Result<PublicKey, DecodingError>
pub fn try_from_bytes(k: &[u8]) -> Result<PublicKey, DecodingError>
Try to parse a public key from a byte array containing the actual key as produced by to_bytes
.
Trait Implementations§
source§impl Ord for PublicKey
impl Ord for PublicKey
source§impl PartialEq for PublicKey
impl PartialEq for PublicKey
source§impl PartialOrd for PublicKey
impl PartialOrd for PublicKey
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Eq for PublicKey
impl StructuralEq 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§
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