Struct vodozemac::Ed25519PublicKey
source · [−]pub struct Ed25519PublicKey(_);
Expand description
An Ed25519 public key, used to verify digital signatures.
Implementations
sourceimpl Ed25519PublicKey
impl Ed25519PublicKey
sourcepub fn from_slice(bytes: &[u8]) -> Result<Self, KeyError>
pub fn from_slice(bytes: &[u8]) -> Result<Self, KeyError>
Try to create a Ed25519PublicKey
from a slice of bytes.
sourcepub fn from_base64(base64_key: &str) -> Result<Self, KeyError>
pub fn from_base64(base64_key: &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
sourceimpl Clone for Ed25519PublicKey
impl Clone for Ed25519PublicKey
sourcefn clone(&self) -> Ed25519PublicKey
fn clone(&self) -> Ed25519PublicKey
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for Ed25519PublicKey
impl Debug for Ed25519PublicKey
sourceimpl<'de> Deserialize<'de> for Ed25519PublicKey
impl<'de> Deserialize<'de> for Ed25519PublicKey
sourcefn 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
sourceimpl PartialEq<Ed25519PublicKey> for Ed25519PublicKey
impl PartialEq<Ed25519PublicKey> for Ed25519PublicKey
sourcefn 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 ==
. Read more
sourcefn ne(&self, other: &Ed25519PublicKey) -> bool
fn ne(&self, other: &Ed25519PublicKey) -> bool
This method tests for !=
.
sourceimpl Serialize for Ed25519PublicKey
impl Serialize for Ed25519PublicKey
impl Copy for Ed25519PublicKey
impl Eq for Ed25519PublicKey
impl StructuralEq for Ed25519PublicKey
impl StructuralPartialEq for Ed25519PublicKey
Auto Trait Implementations
impl RefUnwindSafe for Ed25519PublicKey
impl Send for Ed25519PublicKey
impl Sync for Ed25519PublicKey
impl Unpin for Ed25519PublicKey
impl UnwindSafe for Ed25519PublicKey
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more