Trait diem_sdk::crypto::ValidCryptoMaterial [−][src]
pub trait ValidCryptoMaterial: for<'a> TryFrom<&'a [u8], Error = CryptoMaterialError> + Serialize + DeserializeOwned { fn to_bytes(&self) -> Vec<u8, Global>; }
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
fn to_bytes(&self) -> Vec<u8, Global>
[src]
Expand description
Convert the valid crypto material to bytes.
Implementors
impl ValidCryptoMaterial for Ed25519PublicKey
[src]
impl ValidCryptoMaterial for Ed25519PublicKey
[src]impl ValidCryptoMaterial for Ed25519Signature
[src]
impl ValidCryptoMaterial for Ed25519Signature
[src]impl ValidCryptoMaterial for PrivateKey
[src]
impl ValidCryptoMaterial for PrivateKey
[src]