[][src]Trait rcmixed::traits::PublicKeyAlgorithm

pub trait PublicKeyAlgorithm {
    type PublicKey: Serialize + DeserializeOwned;
    type SecretKey: Serialize + DeserializeOwned;

    const SECRET_KEY_LENGTH: usize;

    fn encrypt(plain: &[u8], public_key: &Self::PublicKey) -> Vec<u8>;
fn decrypt(cipher: &[u8], secret_key: &Self::SecretKey) -> Vec<u8>;
fn from_bytes(bytes: &[u8]) -> Option<Self::SecretKey>;
fn to_bytes(secret_key: &Self::SecretKey) -> Vec<u8>; }

Associated Types

Loading content...

Associated Constants

Loading content...

Required methods

fn encrypt(plain: &[u8], public_key: &Self::PublicKey) -> Vec<u8>

fn decrypt(cipher: &[u8], secret_key: &Self::SecretKey) -> Vec<u8>

fn from_bytes(bytes: &[u8]) -> Option<Self::SecretKey>

fn to_bytes(secret_key: &Self::SecretKey) -> Vec<u8>

Loading content...

Implementors

Loading content...