pub struct CryptFilterManager { /* private fields */ }Expand description
Crypt Filter Manager
Implementations§
Source§impl CryptFilterManager
impl CryptFilterManager
Sourcepub fn new(
security_handler: Box<dyn SecurityHandler>,
default_stream_filter: String,
default_string_filter: String,
) -> Self
pub fn new( security_handler: Box<dyn SecurityHandler>, default_stream_filter: String, default_string_filter: String, ) -> Self
Create new crypt filter manager
Sourcepub fn add_filter(&mut self, filter: FunctionalCryptFilter)
pub fn add_filter(&mut self, filter: FunctionalCryptFilter)
Add a crypt filter
Sourcepub fn set_embedded_files_filter(&mut self, filter_name: String)
pub fn set_embedded_files_filter(&mut self, filter_name: String)
Set embedded files filter
Sourcepub fn get_filter(&self, name: &str) -> Option<&FunctionalCryptFilter>
pub fn get_filter(&self, name: &str) -> Option<&FunctionalCryptFilter>
Get filter by name
Sourcepub fn encrypt_string(
&self,
data: &[u8],
obj_id: &ObjectId,
filter_name: Option<&str>,
encryption_key: &EncryptionKey,
) -> Result<Vec<u8>>
pub fn encrypt_string( &self, data: &[u8], obj_id: &ObjectId, filter_name: Option<&str>, encryption_key: &EncryptionKey, ) -> Result<Vec<u8>>
Encrypt string with appropriate filter
Sourcepub fn decrypt_string(
&self,
data: &[u8],
obj_id: &ObjectId,
filter_name: Option<&str>,
encryption_key: &EncryptionKey,
) -> Result<Vec<u8>>
pub fn decrypt_string( &self, data: &[u8], obj_id: &ObjectId, filter_name: Option<&str>, encryption_key: &EncryptionKey, ) -> Result<Vec<u8>>
Decrypt string with appropriate filter
Sourcepub fn encrypt_stream(
&self,
data: &[u8],
obj_id: &ObjectId,
stream_dict: &Dictionary,
encryption_key: &EncryptionKey,
) -> Result<Vec<u8>>
pub fn encrypt_stream( &self, data: &[u8], obj_id: &ObjectId, stream_dict: &Dictionary, encryption_key: &EncryptionKey, ) -> Result<Vec<u8>>
Encrypt stream with appropriate filter
Sourcepub fn decrypt_stream(
&self,
data: &[u8],
obj_id: &ObjectId,
stream_dict: &Dictionary,
encryption_key: &EncryptionKey,
) -> Result<Vec<u8>>
pub fn decrypt_stream( &self, data: &[u8], obj_id: &ObjectId, stream_dict: &Dictionary, encryption_key: &EncryptionKey, ) -> Result<Vec<u8>>
Decrypt stream with appropriate filter
Sourcepub fn create_standard_filter(
method: CryptFilterMethod,
key_length: Option<u32>,
) -> FunctionalCryptFilter
pub fn create_standard_filter( method: CryptFilterMethod, key_length: Option<u32>, ) -> FunctionalCryptFilter
Create StdCF filter for standard encryption
Sourcepub fn to_cf_dict(&self) -> Dictionary
pub fn to_cf_dict(&self) -> Dictionary
Convert filters to PDF dictionary
Auto Trait Implementations§
impl Freeze for CryptFilterManager
impl !RefUnwindSafe for CryptFilterManager
impl Send for CryptFilterManager
impl Sync for CryptFilterManager
impl Unpin for CryptFilterManager
impl !UnwindSafe for CryptFilterManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more