Trait cypher::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>

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl EcSk for SecretKey

Available on crate feature ed25519 only.
§

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.
§

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.