mithril_common::crypto_helper

Trait ProtocolKeyCodec

Source
pub trait ProtocolKeyCodec<T: Serialize + DeserializeOwned>: Sized {
    // Provided methods
    fn decode_key(encoded: &str) -> StdResult<ProtocolKey<T>> { ... }
    fn encode_key(key: &T) -> StdResult<String> { ... }
}
Expand description

The codec used to serialize/deserialize a ProtocolKey.

Default to json hex.

Provided Methods§

Source

fn decode_key(encoded: &str) -> StdResult<ProtocolKey<T>>

Do the decoding of the given key

Source

fn encode_key(key: &T) -> StdResult<String>

Do the encoding of the given key

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 ProtocolKeyCodec<VerificationKeyPoP> for StmVerificationKeyPoP

Source§

impl ProtocolKeyCodec<StmAggrSig<CoreWrapper<CtVariableCoreWrapper<Blake2bVarCore, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>>>> for StmAggrSig<Blake2b<U32>>

Source§

impl ProtocolKeyCodec<StmAggrVerificationKey<CoreWrapper<CtVariableCoreWrapper<Blake2bVarCore, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>>>> for StmAggrVerificationKey<Blake2b<U32>>

Source§

impl ProtocolKeyCodec<StmSig> for StmSig

Source§

impl ProtocolKeyCodec<Signature> for Signature

Source§

fn decode_key(encoded: &str) -> StdResult<ProtocolKey<Signature>>

Source§

fn encode_key(key: &Signature) -> StdResult<String>

Source§

impl ProtocolKeyCodec<SigningKey> for SigningKey

Source§

impl ProtocolKeyCodec<Sum6KesSig> for Sum6KesSig

Source§

impl ProtocolKeyCodec<VerifyingKey> for VerifyingKey

Implementors§