Struct vodozemac::Ed25519PublicKey
source · 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§fn eq(&self, other: &Ed25519PublicKey) -> bool
fn eq(&self, other: &Ed25519PublicKey) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)