pub struct VerifyingKey { /* private fields */ }signing only.Expand description
Ed448 public key as defined in [RFC8032 § 5.2.5]
Implementations§
Source§impl VerifyingKey
impl VerifyingKey
Sourcepub fn from_bytes(bytes: &[u8; 57]) -> Result<Self, Error>
pub fn from_bytes(bytes: &[u8; 57]) -> Result<Self, Error>
Construct a VerifyingKey from a slice of bytes.
Sourcepub fn with_context<'k, 'v>(
&'k self,
context: &'v [u8],
) -> Context<'k, 'v, Self>
pub fn with_context<'k, 'v>( &'k self, context: &'v [u8], ) -> Context<'k, 'v, Self>
Create a context for this verifying key that can be used with [DigestVerifier].
Sourcepub fn to_edwards(self) -> EdwardsPoint
pub fn to_edwards(self) -> EdwardsPoint
Return the verifying key in Edwards form.
Sourcepub fn verify_raw(
&self,
signature: &Signature,
message: &[u8],
) -> Result<(), Error>
pub fn verify_raw( &self, signature: &Signature, message: &[u8], ) -> Result<(), Error>
Verifies a signature on a message.
This is the “Ed448” mode of RFC 8032 (no pre-hashing, a
context is provided). This is equivalent to verify_ctx()
with an empty (zero-length) context.
Note: this function is not constant-time; it assumes that the public key and signature value are public data.
Sourcepub fn verify_ctx(
self,
sig: &Signature,
ctx: &[u8],
message: &[u8],
) -> Result<(), Error>
pub fn verify_ctx( self, sig: &Signature, ctx: &[u8], message: &[u8], ) -> Result<(), Error>
Verifies a signature on a message (with context).
This is the “Ed448” mode of RFC 8032 (no pre-hashing, a
context is provided). The context string MUST have length at most
255 bytes. Return value is Ok on a valid signature, Error
otherwise.
Note: this function is not constant-time; it assumes that the public key and signature value are public data.
Sourcepub fn verify_prehashed<D>(
self,
sig: &Signature,
ctx: Option<&[u8]>,
prehashed_message: D,
) -> Result<(), Error>where
D: PreHash,
pub fn verify_prehashed<D>(
self,
sig: &Signature,
ctx: Option<&[u8]>,
prehashed_message: D,
) -> Result<(), Error>where
D: PreHash,
Verifies a signature on a hashed message.
This is the “Ed448ph” mode of RFC 8032 (message is pre-hashed),
also known as “HashEdDSA on Curve448”. The hashed message prehashed_message
is provided (presumably, that hash value was obtained with
SHAKE256 and a 64-byte output; the caller does the hashing itself).
A context string ctx is
also provided; it MUST have length at most 255 bytes. Return
value is Ok on a valid signature, Error otherwise.
Note: this function is not constant-time; it assumes that the public key and signature value are public data.
Trait Implementations§
Source§impl AsRef<[u8]> for VerifyingKey
impl AsRef<[u8]> for VerifyingKey
Source§impl Clone for VerifyingKey
impl Clone for VerifyingKey
Source§fn clone(&self) -> VerifyingKey
fn clone(&self) -> VerifyingKey
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for VerifyingKey
impl Debug for VerifyingKey
Source§impl Default for VerifyingKey
impl Default for VerifyingKey
Source§fn default() -> VerifyingKey
fn default() -> VerifyingKey
Source§impl<D> DigestVerifier<D, Signature> for VerifyingKeywhere
D: Digest,
impl<D> DigestVerifier<D, Signature> for VerifyingKeywhere
D: Digest,
Source§impl EncodePublicKey for VerifyingKey
Available on (crate features alloc or std) and crate feature pkcs8 only.
impl EncodePublicKey for VerifyingKey
alloc or std) and crate feature pkcs8 only.Source§fn to_public_key_der(&self) -> Result<Document>
fn to_public_key_der(&self) -> Result<Document>
Document containing a SPKI-encoded public key.Source§fn to_public_key_pem(&self, line_ending: LineEnding) -> Result<String, Error>
fn to_public_key_pem(&self, line_ending: LineEnding) -> Result<String, Error>
LineEnding.Source§impl From<VerifyingKey> for PublicKeyBytes
Available on crate feature pkcs8 only.
impl From<VerifyingKey> for PublicKeyBytes
pkcs8 only.Source§fn from(key: VerifyingKey) -> Self
fn from(key: VerifyingKey) -> Self
Source§impl Hash for VerifyingKey
impl Hash for VerifyingKey
Source§impl PartialEq for VerifyingKey
impl PartialEq for VerifyingKey
Source§impl TryFrom<&PublicKeyBytes> for VerifyingKey
Available on crate feature pkcs8 only.
impl TryFrom<&PublicKeyBytes> for VerifyingKey
pkcs8 only.Source§impl TryFrom<PublicKeyBytes> for VerifyingKey
Available on crate feature pkcs8 only.
impl TryFrom<PublicKeyBytes> for VerifyingKey
pkcs8 only.Source§impl TryFrom<SubjectPublicKeyInfo<AnyRef<'_>, BitStringRef<'_>>> for VerifyingKey
Available on crate feature pkcs8 only.
impl TryFrom<SubjectPublicKeyInfo<AnyRef<'_>, BitStringRef<'_>>> for VerifyingKey
pkcs8 only.Source§impl Verifier<Signature> for VerifyingKey
impl Verifier<Signature> for VerifyingKey
impl Copy for VerifyingKey
impl Eq for VerifyingKey
Auto Trait Implementations§
impl Freeze for VerifyingKey
impl RefUnwindSafe for VerifyingKey
impl Send for VerifyingKey
impl Sync for VerifyingKey
impl Unpin for VerifyingKey
impl UnwindSafe for VerifyingKey
Blanket Implementations§
Source§impl<A, T> AsBits<T> for A
impl<A, T> AsBits<T> for A
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DecodePublicKey for T
impl<T> DecodePublicKey for T
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.