Trait ToEncodableKey

pub trait ToEncodableKey: From<Self::KeyPair> {
    type Key: EncodableItem + 'static + From<<Self::KeyPair as ToEncodableKey>::Key>;
    type KeyPair: ToEncodableKey;

    // Required methods
    fn to_encodable_key(self) -> Self::Key;
    fn from_encodable_key(key: Self::Key) -> Self;
}
Expand description

A key that can be converted to an EncodableItem.

Required Associated Types§

type Key: EncodableItem + 'static + From<<Self::KeyPair as ToEncodableKey>::Key>

The key type this can be converted to/from.

type KeyPair: ToEncodableKey

The KeyPair (secret+public) of which this key is a subset. For secret keys, this type is Self. For public keys, this type is the corresponding (secret) keypair.

The associated type constraint (where) expresses the fact that a public key is always derivable from its corresponding secret key.

Required Methods§

fn to_encodable_key(self) -> Self::Key

Convert this key to a type that implements EncodableItem.

fn from_encodable_key(key: Self::Key) -> Self

Convert an EncodableItem to another key type.

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§

§

impl ToEncodableKey for HsBlindIdKey

§

type Key = PublicKey

§

type KeyPair = HsBlindIdKeypair

§

fn to_encodable_key(self) -> <HsBlindIdKey as ToEncodableKey>::Key

§

fn from_encodable_key( key: <HsBlindIdKey as ToEncodableKey>::Key, ) -> HsBlindIdKey

§

impl ToEncodableKey for HsBlindIdKeypair

§

type Key = ExpandedKeypair

§

type KeyPair = HsBlindIdKeypair

§

fn to_encodable_key(self) -> <HsBlindIdKeypair as ToEncodableKey>::Key

§

fn from_encodable_key( key: <HsBlindIdKeypair as ToEncodableKey>::Key, ) -> HsBlindIdKeypair

§

impl ToEncodableKey for HsClientDescEncKeypair

§

type Key = StaticKeypair

§

type KeyPair = HsClientDescEncKeypair

§

fn to_encodable_key(self) -> <HsClientDescEncKeypair as ToEncodableKey>::Key

§

fn from_encodable_key( key: <HsClientDescEncKeypair as ToEncodableKey>::Key, ) -> HsClientDescEncKeypair

§

impl ToEncodableKey for HsDescSigningKeypair

§

type Key = Keypair

§

type KeyPair = HsDescSigningKeypair

§

fn to_encodable_key(self) -> <HsDescSigningKeypair as ToEncodableKey>::Key

§

fn from_encodable_key( key: <HsDescSigningKeypair as ToEncodableKey>::Key, ) -> HsDescSigningKeypair

§

impl ToEncodableKey for HsIdKey

§

type Key = PublicKey

§

type KeyPair = HsIdKeypair

§

fn to_encodable_key(self) -> <HsIdKey as ToEncodableKey>::Key

§

fn from_encodable_key(key: <HsIdKey as ToEncodableKey>::Key) -> HsIdKey

§

impl ToEncodableKey for HsIdKeypair

§

type Key = ExpandedKeypair

§

type KeyPair = HsIdKeypair

§

fn to_encodable_key(self) -> <HsIdKeypair as ToEncodableKey>::Key

§

fn from_encodable_key(key: <HsIdKeypair as ToEncodableKey>::Key) -> HsIdKeypair

§

impl ToEncodableKey for HsIntroPtSessionIdKeypair

§

type Key = Keypair

§

type KeyPair = HsIntroPtSessionIdKeypair

§

fn to_encodable_key(self) -> <HsIntroPtSessionIdKeypair as ToEncodableKey>::Key

§

fn from_encodable_key( key: <HsIntroPtSessionIdKeypair as ToEncodableKey>::Key, ) -> HsIntroPtSessionIdKeypair

§

impl ToEncodableKey for HsSvcNtorKeypair

§

type Key = StaticKeypair

§

type KeyPair = HsSvcNtorKeypair

§

fn to_encodable_key(self) -> <HsSvcNtorKeypair as ToEncodableKey>::Key

§

fn from_encodable_key( key: <HsSvcNtorKeypair as ToEncodableKey>::Key, ) -> HsSvcNtorKeypair

Implementors§

impl ToEncodableKey for RelayIdentityKeypair

impl ToEncodableKey for RelayLinkSigningKeypair

impl ToEncodableKey for RelaySigningKeypair