pub trait ECKey: ECKeyBase + UREncodable {
// Required method
fn public_key(&self) -> ECPublicKey;
}
Expand description
A trait for elliptic curve keys that can derive a public key.
This trait extends ECKeyBase
to provide a method for deriving
the corresponding compressed public key. It is implemented by both
private keys (where it generates the public key) and public keys
(where it may return self or convert between formats).
Required Methods§
Sourcefn public_key(&self) -> ECPublicKey
fn public_key(&self) -> ECPublicKey
Returns the compressed public key corresponding to this key.
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.
Implementors§
impl ECKey for ECPrivateKey
Implements the ECKey
trait for deriving public keys.
impl ECKey for ECPublicKey
Implements the ECKey
trait for ECPublicKey
.
impl ECKey for ECUncompressedPublicKey
Implements the ECKey
trait for converting to compressed format.