[−][src]Trait pbd::dsg::PrivacySecurityGuard
Trait that provides the DaaS security functionality
Provided methods
fn clean_decrypted(&self, message: Vec<u8>) -> Vec<u8>
Removes the control NUL characters form the decrypted message
fn data_from_tranfer(
&self,
priv_key: Vec<u8>,
transfer_set: TransferSet
) -> Result<Vec<u8>, Error>
&self,
priv_key: Vec<u8>,
transfer_set: TransferSet
) -> Result<Vec<u8>, Error>
fn decrypt_data(
&self,
key: Vec<u8>,
nonce: Option<&[u8]>,
data_to_decrypt: Vec<u8>
) -> Result<Vec<u8>, Error>
&self,
key: Vec<u8>,
nonce: Option<&[u8]>,
data_to_decrypt: Vec<u8>
) -> Result<Vec<u8>, Error>
Decrypts the data (small or large) using the symmetric key, IV and AES encryption algorithm
fn decrypt_symmetric_key(
&self,
priv_key: Vec<u8>,
encrypted_key: Vec<u8>,
padding: Padding
) -> Result<Vec<u8>, Error>
&self,
priv_key: Vec<u8>,
encrypted_key: Vec<u8>,
padding: Padding
) -> Result<Vec<u8>, Error>
Decrypts the symmetric key using RSA algorithm for the specified padding
fn encrypt_data(
&self,
key: Vec<u8>,
nonce: Option<&[u8]>,
data_to_encrypt: Vec<u8>
) -> Result<Vec<u8>, Error>
&self,
key: Vec<u8>,
nonce: Option<&[u8]>,
data_to_encrypt: Vec<u8>
) -> Result<Vec<u8>, Error>
Encrypts the data (small or large) using the symmetric key, IV and AES encryption algorithm
fn encrypt_symmetric_key(
&self,
pub_key: Vec<u8>,
key_to_encrypt: Vec<u8>,
padding: Padding
) -> Result<Vec<u8>, Error>
&self,
pub_key: Vec<u8>,
key_to_encrypt: Vec<u8>,
padding: Padding
) -> Result<Vec<u8>, Error>
Encrypts the symmetric key using RSA algorithm for the specified padding
fn generate_keypair(&self) -> Result<(Vec<u8>, Vec<u8>, usize), Error>
Generates a RSA (private/public) keypair
fn generate_symmetric_key(&self) -> Vec<u8>
Generates a random alphanumeric key with a length of 16 characters
fn generate_nonce(&self) -> Vec<u8>
Generates a random alphanumeric nonce (a.k.a. IV) with a length of 16 characters
fn secure_for_tranfer(
&self,
pub_key: Vec<u8>,
data_to_encrypt: Vec<u8>,
padding: Padding
) -> Result<TransferSet, Error>
&self,
pub_key: Vec<u8>,
data_to_encrypt: Vec<u8>,
padding: Padding
) -> Result<TransferSet, Error>
Implementors
impl PrivacySecurityGuard for PrivacyGuard
[src]
Implementaitons of the PrivacySecurityGuard