cas-lib 0.2.87

A function wrapper layer for RustCrypto and Dalek-Cryptography. Intended to be used in FFI situations with a global heap deallactor at the top level project.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use crate::error::CasResult;

pub struct RSAKeyPairResult {
    pub private_key: String,
    pub public_key: String,
}

pub trait CASRSAEncryption {
    fn generate_rsa_keys(key_size: usize) -> CasResult<RSAKeyPairResult>;
    fn sign(private_key: String, hash: Vec<u8>) -> CasResult<Vec<u8>>;
    fn verify(public_key: String, hash: Vec<u8>, signed_text: Vec<u8>) -> CasResult<bool>;
}