pub struct PdfSecurity {
pub owner_password: String,
pub user_password: String,
pub permissions: PdfPermissions,
pub key_length: u32,
pub algorithm: EncryptionAlgorithm,
}Expand description
PDF encryption settings
Fields§
§owner_password: StringOwner password (controls permissions)
user_password: StringUser password (required to open document)
permissions: PdfPermissionsPermission flags
key_length: u32Encryption key length in bits (40 or 128 for RC4; 256 for AES)
algorithm: EncryptionAlgorithmEncryption algorithm
Implementations§
Source§impl PdfSecurity
impl PdfSecurity
Sourcepub fn new(
owner_password: &str,
user_password: &str,
permissions: PdfPermissions,
) -> Self
pub fn new( owner_password: &str, user_password: &str, permissions: PdfPermissions, ) -> Self
Create new security settings with RC4-128 encryption (legacy default)
Sourcepub fn new_aes256(
owner_password: &str,
user_password: &str,
permissions: PdfPermissions,
) -> Self
pub fn new_aes256( owner_password: &str, user_password: &str, permissions: PdfPermissions, ) -> Self
Create new security settings with AES-256 encryption (PDF 2.0)
Sourcepub fn compute_encryption_dict(&self, file_id: &[u8]) -> EncryptionDict
pub fn compute_encryption_dict(&self, file_id: &[u8]) -> EncryptionDict
Compute the encryption dictionary entries
Dispatches to the appropriate algorithm implementation.
Trait Implementations§
Source§impl Clone for PdfSecurity
impl Clone for PdfSecurity
Source§fn clone(&self) -> PdfSecurity
fn clone(&self) -> PdfSecurity
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 PdfSecurity
impl RefUnwindSafe for PdfSecurity
impl Send for PdfSecurity
impl Sync for PdfSecurity
impl Unpin for PdfSecurity
impl UnsafeUnpin for PdfSecurity
impl UnwindSafe for PdfSecurity
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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