pub trait ECKeyBase:
Display
+ Debug
+ Clone
+ PartialEq
+ Eq
+ Hash {
const KEY_SIZE: usize;
// Required methods
fn from_data_ref(data: impl AsRef<[u8]>) -> Result<Self>
where Self: Sized;
fn data(&self) -> &[u8] ⓘ;
// Provided methods
fn hex(&self) -> String { ... }
fn from_hex(hex: impl AsRef<str>) -> Result<Self> { ... }
}
Expand description
A base trait for all elliptic curve keys.
This trait defines common functionality for all elliptic curve keys, including both private and public keys. It provides methods for key construction from binary data and hexadecimal strings, as well as conversion to hexadecimal format.
All EC key types have a fixed size depending on their specific type:
- EC private keys: 32 bytes
- EC compressed public keys: 33 bytes
- EC uncompressed public keys: 65 bytes
- Schnorr public keys: 32 bytes
Required Associated Constants§
Required Methods§
Provided Methods§
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§
Source§impl ECKeyBase for ECPrivateKey
Implements the ECKeyBase
trait methods.
impl ECKeyBase for ECPrivateKey
Implements the ECKeyBase
trait methods.
Source§impl ECKeyBase for ECPublicKey
Implements the ECKeyBase
trait methods for ECPublicKey
.
impl ECKeyBase for ECPublicKey
Implements the ECKeyBase
trait methods for ECPublicKey
.
Source§impl ECKeyBase for ECUncompressedPublicKey
Implements the ECKeyBase
trait methods for ECUncompressedPublicKey
.
impl ECKeyBase for ECUncompressedPublicKey
Implements the ECKeyBase
trait methods for ECUncompressedPublicKey
.