pub trait ValidCryptoMaterial: for<'a> TryFrom<&'a [u8], Error = CryptoMaterialError> + Serialize + DeserializeOwned {
    // Required method
    fn to_bytes(&self) -> Vec<u8> ;
}
Expand description

Key or more generally crypto material with a notion of byte validation.

A type family for material that knows how to serialize and deserialize, as well as validate byte-encoded material. The validation must be implemented as a TryFrom which classifies its failures against the above CryptoMaterialError.

This provides an implementation for a validation that relies on a round-trip to bytes and corresponding TryFrom.

Required Methods§

source

fn to_bytes(&self) -> Vec<u8>

Convert the valid crypto material to bytes.

Implementors§