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)
.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.