pub trait PublicKey: Sealed + Sized {
type Private: PrivateKey<Public = Self>;
// Provided method
fn is_valid<S: Signature<PrivateKey = Self::Private>>(
&self,
message: &[u8],
signature: &S,
) -> bool { ... }
}
Expand description
The public component of a public/private key pair.
Required Associated Types§
sourcetype Private: PrivateKey<Public = Self>
type Private: PrivateKey<Public = Self>
The type of the private component.
Provided Methods§
sourcefn is_valid<S: Signature<PrivateKey = Self::Private>>(
&self,
message: &[u8],
signature: &S,
) -> bool
fn is_valid<S: Signature<PrivateKey = Self::Private>>( &self, message: &[u8], signature: &S, ) -> bool
Verifies a message with this public key.
is_valid
verifies that a message was signed by the private key
corresponding to this public key. It is equivalent to
signature.is_valid(self, message)
.
Object Safety§
This trait is not object safe.