Trait adnl::AdnlPrivateKey

source ·
pub trait AdnlPrivateKey {
    type PublicKey: AdnlPublicKey;

    // Required methods
    fn key_agreement<P: AdnlPublicKey>(&self, their_public: P) -> AdnlSecret;
    fn public(&self) -> Self::PublicKey;
}
Expand description

Trait which must be implemented to perform key agreement inside [AdnlHandshake]

Required Associated Types§

Required Methods§

source

fn key_agreement<P: AdnlPublicKey>(&self, their_public: P) -> AdnlSecret

Perform key agreement protocol (usually x25519) between our private key and their public

source

fn public(&self) -> Self::PublicKey

Get public key corresponding to this private

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl AdnlPrivateKey for StaticSecret

§

type PublicKey = PublicKey

source§

fn key_agreement<P: AdnlPublicKey>(&self, their_public: P) -> AdnlSecret

source§

fn public(&self) -> Self::PublicKey

Implementors§