pub struct Ed448VerifyingKey { /* private fields */ }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<VerifyingKey, Error>
pub fn from_bytes(bytes: &[u8; 57]) -> Result<VerifyingKey, Error>
Construct a VerifyingKey from a slice of bytes.
Sourcepub fn with_context<'k, 'v>(
&'k self,
context: &'v [u8],
) -> Context<'k, 'v, VerifyingKey>
pub fn with_context<'k, 'v>( &'k self, context: &'v [u8], ) -> Context<'k, 'v, VerifyingKey>
Create a context for this verifying key that can be used with signature::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 VerifyingKey
impl<D> DigestVerifier<D, Signature> for VerifyingKey
Source§impl DynSignatureAlgorithmIdentifier for VerifyingKey
impl DynSignatureAlgorithmIdentifier for VerifyingKey
Source§fn signature_algorithm_identifier(
&self,
) -> Result<AlgorithmIdentifier<Any>, Error>
fn signature_algorithm_identifier( &self, ) -> Result<AlgorithmIdentifier<Any>, Error>
AlgorithmIdentifier for the corresponding signature system.Source§impl EncodePublicKey for VerifyingKey
impl EncodePublicKey for VerifyingKey
Source§fn to_public_key_der(&self) -> Result<Document, Error>
fn to_public_key_der(&self) -> Result<Document, Error>
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§fn write_public_key_der_file(&self, path: impl AsRef<Path>) -> Result<(), Error>
fn write_public_key_der_file(&self, path: impl AsRef<Path>) -> Result<(), Error>
Source§fn write_public_key_pem_file(
&self,
path: impl AsRef<Path>,
line_ending: LineEnding,
) -> Result<(), Error>
fn write_public_key_pem_file( &self, path: impl AsRef<Path>, line_ending: LineEnding, ) -> Result<(), Error>
Source§impl Hash for VerifyingKey
impl Hash for VerifyingKey
Source§impl PartialEq for VerifyingKey
impl PartialEq for VerifyingKey
Source§impl TryFrom<&PublicKeyBytes> for VerifyingKey
impl TryFrom<&PublicKeyBytes> for VerifyingKey
Source§fn try_from(
value: &PublicKeyBytes,
) -> Result<VerifyingKey, <VerifyingKey as TryFrom<&PublicKeyBytes>>::Error>
fn try_from( value: &PublicKeyBytes, ) -> Result<VerifyingKey, <VerifyingKey as TryFrom<&PublicKeyBytes>>::Error>
Source§impl TryFrom<PublicKeyBytes> for VerifyingKey
impl TryFrom<PublicKeyBytes> for VerifyingKey
Source§fn try_from(
value: PublicKeyBytes,
) -> Result<VerifyingKey, <VerifyingKey as TryFrom<PublicKeyBytes>>::Error>
fn try_from( value: PublicKeyBytes, ) -> Result<VerifyingKey, <VerifyingKey as TryFrom<PublicKeyBytes>>::Error>
Source§impl TryFrom<SubjectPublicKeyInfo<AnyRef<'_>, BitStringRef<'_>>> for VerifyingKey
impl TryFrom<SubjectPublicKeyInfo<AnyRef<'_>, BitStringRef<'_>>> for VerifyingKey
Source§fn try_from(
public_key: SubjectPublicKeyInfo<AnyRef<'_>, BitStringRef<'_>>,
) -> Result<VerifyingKey, Error>
fn try_from( public_key: SubjectPublicKeyInfo<AnyRef<'_>, BitStringRef<'_>>, ) -> Result<VerifyingKey, Error>
Source§impl Verifier<Signature> for VerifyingKey
impl Verifier<Signature> for VerifyingKey
Source§impl VerifyingKey for Ed448VerifyingKey
impl VerifyingKey for Ed448VerifyingKey
Source§fn verifies(&self, signature: &[u8], message: &[u8]) -> bool
fn verifies(&self, signature: &[u8], message: &[u8]) -> bool
Source§fn from_raw_public_key(bytes: &[u8]) -> Option<Self>where
Self: Sized,
fn from_raw_public_key(bytes: &[u8]) -> Option<Self>where
Self: Sized,
Source§fn from_spki_der(der: &[u8]) -> Option<Self>where
Self: Sized,
fn from_spki_der(der: &[u8]) -> Option<Self>where
Self: Sized,
Source§fn curve_oid(&self) -> ObjectIdentifier
fn curve_oid(&self) -> ObjectIdentifier
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<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§fn from_public_key_der(bytes: &[u8]) -> Result<T, Error>
fn from_public_key_der(bytes: &[u8]) -> Result<T, Error>
SubjectPublicKeyInfo]
(binary format).Source§fn from_public_key_pem(s: &str) -> Result<Self, Error>
fn from_public_key_pem(s: &str) -> Result<Self, Error>
SubjectPublicKeyInfo]. Read more