Trait EcSk

Source
pub trait EcSk:
    Clone
    + Eq
    + Send {
    type Pk: EcPk;

    // Required methods
    fn generate_keypair() -> (Self, Self::Pk)
       where Self: Sized;
    fn to_pk(&self) -> Result<Self::Pk, EcSkInvalid>;
}
Expand description

Elliptic-curve based private key type.

§Safety

The type provides no guarantees on the key validity upon deserialization.

Required Associated Types§

Required Methods§

Source

fn generate_keypair() -> (Self, Self::Pk)
where Self: Sized,

Source

fn to_pk(&self) -> Result<Self::Pk, EcSkInvalid>

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.

Implementations on Foreign Types§

Source§

impl EcSk for SecretKey

Available on crate feature ed25519 only.
Source§

type Pk = PublicKey

Source§

fn generate_keypair() -> (Self, Self::Pk)
where Self: Sized,

Source§

fn to_pk(&self) -> Result<Self::Pk, EcSkInvalid>

Source§

impl EcSk for SecretKey

Available on crate feature x25519 only.
Source§

type Pk = PublicKey

Source§

fn generate_keypair() -> (Self, Self::Pk)
where Self: Sized,

Source§

fn to_pk(&self) -> Result<Self::Pk, EcSkInvalid>

Implementors§

Source§

impl EcSk for cypher::ed25519::PrivateKey

Available on crate feature ed25519 only.
Source§

impl EcSk for cypher::x25519::PrivateKey

Available on crate feature x25519 only.