pub struct Ed25519PublicKey(/* private fields */);
Expand description
An Ed25519 public key, used to verify digital signatures.
Implementations§
Source§impl Ed25519PublicKey
impl Ed25519PublicKey
Sourcepub fn from_slice(bytes: &[u8; 32]) -> Result<Self, KeyError>
pub fn from_slice(bytes: &[u8; 32]) -> Result<Self, KeyError>
Try to create a Ed25519PublicKey
from a slice of bytes.
Sourcepub fn from_base64(input: &str) -> Result<Self, KeyError>
pub fn from_base64(input: &str) -> Result<Self, KeyError>
Instantiate a Ed25519PublicKey public key from an unpadded base64 representation.
Sourcepub fn to_base64(&self) -> String
pub fn to_base64(&self) -> String
Serialize a Ed25519PublicKey public key to an unpadded base64 representation.
Sourcepub fn verify(
&self,
message: &[u8],
signature: &Ed25519Signature,
) -> Result<(), SignatureError>
pub fn verify( &self, message: &[u8], signature: &Ed25519Signature, ) -> Result<(), SignatureError>
Verify that the provided signature for a given message has been signed by the private key matching this public one.
By default this performs an RFC8032 compatible signature check. A
stricter version of the signature check can be enabled with the
strict-signatures
feature flag.
The stricter variant is compatible with libsodium 0.16 and under the
hood uses the [ed25519_dalek::PublicKey::verify_strict()
] method.
Trait Implementations§
Source§impl Clone for Ed25519PublicKey
impl Clone for Ed25519PublicKey
Source§fn clone(&self) -> Ed25519PublicKey
fn clone(&self) -> Ed25519PublicKey
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for Ed25519PublicKey
impl Debug for Ed25519PublicKey
Source§impl<'de> Deserialize<'de> for Ed25519PublicKey
impl<'de> Deserialize<'de> for Ed25519PublicKey
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 Display for Ed25519PublicKey
impl Display for Ed25519PublicKey
Source§impl PartialEq for Ed25519PublicKey
impl PartialEq for Ed25519PublicKey
Source§impl Serialize for Ed25519PublicKey
impl Serialize for Ed25519PublicKey
impl Copy for Ed25519PublicKey
impl Eq for Ed25519PublicKey
impl StructuralPartialEq for Ed25519PublicKey
Auto Trait Implementations§
impl Freeze for Ed25519PublicKey
impl RefUnwindSafe for Ed25519PublicKey
impl Send for Ed25519PublicKey
impl Sync for Ed25519PublicKey
impl Unpin for Ed25519PublicKey
impl UnwindSafe for Ed25519PublicKey
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