Skip to main content

PrivateKeySerialization

Trait PrivateKeySerialization 

Source
pub trait PrivateKeySerialization<G: Group>: Clone {
    type Error;
    type Len: ArrayLength;

    // Required methods
    fn serialize_key_pair(
        key_pair: &KeyPair<G, Self>,
    ) -> GenericArray<u8, Self::Len>;
    fn deserialize_take_key_pair(
        bytes: &mut &[u8],
    ) -> Result<KeyPair<G, Self>, ProtocolError<Self::Error>>;
}
Expand description

A trait to facilitate ServerSetup::de/serialize.

Required Associated Types§

Source

type Error

Custom error type that can be passed down to ProtocolError::Custom

Source

type Len: ArrayLength

Serialization size in bytes.

Required Methods§

Source

fn serialize_key_pair( key_pair: &KeyPair<G, Self>, ) -> GenericArray<u8, Self::Len>

Serialization into bytes

Source

fn deserialize_take_key_pair( bytes: &mut &[u8], ) -> Result<KeyPair<G, Self>, ProtocolError<Self::Error>>

Deserialization from bytes

The deserialized bytes must be taken from bytes.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§