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

Object Safety§

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§