Skip to main content

SecurityHandler

Trait SecurityHandler 

Source
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§

Source

fn encrypt_string( &self, data: &[u8], key: &EncryptionKey, obj_id: &ObjectId, ) -> Result<Vec<u8>>

Encrypt string

Source

fn decrypt_string( &self, data: &[u8], key: &EncryptionKey, obj_id: &ObjectId, ) -> Result<Vec<u8>>

Decrypt string

Source

fn encrypt_stream( &self, data: &[u8], key: &EncryptionKey, obj_id: &ObjectId, ) -> Result<Vec<u8>>

Encrypt stream

Source

fn decrypt_stream( &self, data: &[u8], key: &EncryptionKey, obj_id: &ObjectId, ) -> Result<Vec<u8>>

Decrypt stream

Source

fn encrypt_string_aes( &self, data: &[u8], key: &EncryptionKey, obj_id: &ObjectId, bits: u32, ) -> Result<Vec<u8>>

Encrypt string with AES

Source

fn decrypt_string_aes( &self, data: &[u8], key: &EncryptionKey, obj_id: &ObjectId, bits: u32, ) -> Result<Vec<u8>>

Decrypt string with AES

Source

fn encrypt_stream_aes( &self, data: &[u8], key: &EncryptionKey, obj_id: &ObjectId, bits: u32, ) -> Result<Vec<u8>>

Encrypt stream with AES

Source

fn decrypt_stream_aes( &self, data: &[u8], key: &EncryptionKey, obj_id: &ObjectId, bits: u32, ) -> Result<Vec<u8>>

Decrypt stream with AES

Implementors§