pub struct EncryptionHandler { /* private fields */ }Expand description
Main encryption handler for PDF documents.
This struct manages the encryption state and provides methods for authenticating passwords and decrypting content.
Implementations§
Source§impl EncryptionHandler
impl EncryptionHandler
Sourcepub fn authenticate(&mut self, password: &[u8]) -> Result<bool>
pub fn authenticate(&mut self, password: &[u8]) -> Result<bool>
Authenticate with a password.
This attempts to authenticate with the given password as either a user password or owner password. If successful, the encryption key is derived and stored for future decryption operations.
§Arguments
password- The password to authenticate (empty string for no password)
§Returns
Ok(true) if authentication succeeded, Ok(false) if it failed,
or an error if the encryption is unsupported.
Sourcepub fn is_authenticated(&self) -> bool
pub fn is_authenticated(&self) -> bool
Check if the handler has been authenticated.
Sourcepub fn encryption_key(&self) -> Option<&[u8]>
pub fn encryption_key(&self) -> Option<&[u8]>
Get the encryption key (if authenticated).
Sourcepub fn permissions(&self) -> Permissions
pub fn permissions(&self) -> Permissions
Get the permissions.
Trait Implementations§
Source§impl Clone for EncryptionHandler
impl Clone for EncryptionHandler
Source§fn clone(&self) -> EncryptionHandler
fn clone(&self) -> EncryptionHandler
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for EncryptionHandler
impl RefUnwindSafe for EncryptionHandler
impl Send for EncryptionHandler
impl Sync for EncryptionHandler
impl Unpin for EncryptionHandler
impl UnwindSafe for EncryptionHandler
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