pub struct PublicKey(/* private fields */);Expand description
An ed25519 public key.
Implementations§
Source§impl PublicKey
impl PublicKey
pub const fn new(bytes: [u8; 32]) -> Self
pub const fn from_ref(bytes: &[u8; 32]) -> &Self
pub const fn as_slice(&self) -> &[u8] ⓘ
pub const fn into_inner(self) -> [u8; 32]
pub const fn as_inner(&self) -> &[u8; 32]
Sourcepub fn verify_raw(
&self,
msg: &[u8],
sig: &Signature,
) -> Result<(), InvalidSignature>
pub fn verify_raw( &self, msg: &[u8], sig: &Signature, ) -> Result<(), InvalidSignature>
Verify some raw bytes were signed by this public key.
Sourcepub fn verify_self_signed_struct<'msg, T: Signable + Deserialize<'msg>>(
&self,
serialized: &'msg [u8],
) -> Result<Signed<T>, Error>
pub fn verify_self_signed_struct<'msg, T: Signable + Deserialize<'msg>>( &self, serialized: &'msg [u8], ) -> Result<Signed<T>, Error>
Like ed25519::verify_signed_struct but only allows signatures
produced by this ed25519::PublicKey.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PublicKey
impl<'de> Deserialize<'de> for PublicKey
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
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