pub trait SecretKey<KG: KeGroup>: Clone + Sized {
    type Error;
    type Len: ArrayLength<u8>;

    fn diffie_hellman(
        &self,
        pk: PublicKey<KG>
    ) -> Result<GenericArray<u8, KG::PkLen>, InternalError<Self::Error>>; fn public_key(&self) -> Result<PublicKey<KG>, InternalError<Self::Error>>; fn serialize(&self) -> GenericArray<u8, Self::Len>; fn deserialize(input: &[u8]) -> Result<Self, InternalError<Self::Error>>; }
Expand description

A trait specifying the requirements for a private key container

Required Associated Types

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

Serialization size in bytes.

Required Methods

Diffie-Hellman key exchange implementation

Returns public key from private key

Serialization into bytes

Deserialization from bytes

Implementors