pub trait SecurityHandler: Send + Sync {
// Required methods
fn encrypt_string(
&self,
data: &[u8],
key: &EncryptionKey,
obj_id: &ObjectId,
) -> Result<Vec<u8>>;
fn decrypt_string(
&self,
data: &[u8],
key: &EncryptionKey,
obj_id: &ObjectId,
) -> Result<Vec<u8>>;
fn encrypt_stream(
&self,
data: &[u8],
key: &EncryptionKey,
obj_id: &ObjectId,
) -> Result<Vec<u8>>;
fn decrypt_stream(
&self,
data: &[u8],
key: &EncryptionKey,
obj_id: &ObjectId,
) -> Result<Vec<u8>>;
fn encrypt_string_aes(
&self,
data: &[u8],
key: &EncryptionKey,
obj_id: &ObjectId,
bits: u32,
) -> Result<Vec<u8>>;
fn decrypt_string_aes(
&self,
data: &[u8],
key: &EncryptionKey,
obj_id: &ObjectId,
bits: u32,
) -> Result<Vec<u8>>;
fn encrypt_stream_aes(
&self,
data: &[u8],
key: &EncryptionKey,
obj_id: &ObjectId,
bits: u32,
) -> Result<Vec<u8>>;
fn decrypt_stream_aes(
&self,
data: &[u8],
key: &EncryptionKey,
obj_id: &ObjectId,
bits: u32,
) -> Result<Vec<u8>>;
}Expand description
Security Handler trait for encryption/decryption operations
Required Methods§
Sourcefn encrypt_string(
&self,
data: &[u8],
key: &EncryptionKey,
obj_id: &ObjectId,
) -> Result<Vec<u8>>
fn encrypt_string( &self, data: &[u8], key: &EncryptionKey, obj_id: &ObjectId, ) -> Result<Vec<u8>>
Encrypt string
Sourcefn decrypt_string(
&self,
data: &[u8],
key: &EncryptionKey,
obj_id: &ObjectId,
) -> Result<Vec<u8>>
fn decrypt_string( &self, data: &[u8], key: &EncryptionKey, obj_id: &ObjectId, ) -> Result<Vec<u8>>
Decrypt string
Sourcefn encrypt_stream(
&self,
data: &[u8],
key: &EncryptionKey,
obj_id: &ObjectId,
) -> Result<Vec<u8>>
fn encrypt_stream( &self, data: &[u8], key: &EncryptionKey, obj_id: &ObjectId, ) -> Result<Vec<u8>>
Encrypt stream
Sourcefn decrypt_stream(
&self,
data: &[u8],
key: &EncryptionKey,
obj_id: &ObjectId,
) -> Result<Vec<u8>>
fn decrypt_stream( &self, data: &[u8], key: &EncryptionKey, obj_id: &ObjectId, ) -> Result<Vec<u8>>
Decrypt stream
Sourcefn encrypt_string_aes(
&self,
data: &[u8],
key: &EncryptionKey,
obj_id: &ObjectId,
bits: u32,
) -> Result<Vec<u8>>
fn encrypt_string_aes( &self, data: &[u8], key: &EncryptionKey, obj_id: &ObjectId, bits: u32, ) -> Result<Vec<u8>>
Encrypt string with AES
Sourcefn decrypt_string_aes(
&self,
data: &[u8],
key: &EncryptionKey,
obj_id: &ObjectId,
bits: u32,
) -> Result<Vec<u8>>
fn decrypt_string_aes( &self, data: &[u8], key: &EncryptionKey, obj_id: &ObjectId, bits: u32, ) -> Result<Vec<u8>>
Decrypt string with AES
Sourcefn encrypt_stream_aes(
&self,
data: &[u8],
key: &EncryptionKey,
obj_id: &ObjectId,
bits: u32,
) -> Result<Vec<u8>>
fn encrypt_stream_aes( &self, data: &[u8], key: &EncryptionKey, obj_id: &ObjectId, bits: u32, ) -> Result<Vec<u8>>
Encrypt stream with AES
Sourcefn decrypt_stream_aes(
&self,
data: &[u8],
key: &EncryptionKey,
obj_id: &ObjectId,
bits: u32,
) -> Result<Vec<u8>>
fn decrypt_stream_aes( &self, data: &[u8], key: &EncryptionKey, obj_id: &ObjectId, bits: u32, ) -> Result<Vec<u8>>
Decrypt stream with AES
Implementors§
impl SecurityHandler for PublicKeySecurityHandler
impl SecurityHandler for StandardSecurityHandler
Standard Security Handler implementation