pub struct EncryptionConfig {
pub user_password: Vec<u8>,
pub owner_password: Vec<u8>,
pub permissions: Permissions,
pub method: EncryptionMethod,
pub encrypt_metadata: bool,
}Expand description
Configuration for encrypting a new PDF document.
Fields§
§user_password: Vec<u8>User password (may be empty for open access).
owner_password: Vec<u8>Owner password (for full control).
permissions: PermissionsPermission flags.
method: EncryptionMethodEncryption method.
encrypt_metadata: boolWhether to encrypt metadata streams.
Implementations§
Source§impl EncryptionConfig
impl EncryptionConfig
Sourcepub fn build(
&self,
file_id: &[u8],
) -> Result<(SecurityState, PdfDict, Vec<PdfObject>)>
pub fn build( &self, file_id: &[u8], ) -> Result<(SecurityState, PdfDict, Vec<PdfObject>)>
Build the encryption dict, generate keys, and return a SecurityState suitable for encrypting objects during serialization.
Also returns the encryption PdfDict to be added as an indirect object, and the /ID array to be added to the trailer.
Trait Implementations§
Source§impl Clone for EncryptionConfig
impl Clone for EncryptionConfig
Source§fn clone(&self) -> EncryptionConfig
fn clone(&self) -> EncryptionConfig
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 EncryptionConfig
impl RefUnwindSafe for EncryptionConfig
impl Send for EncryptionConfig
impl Sync for EncryptionConfig
impl Unpin for EncryptionConfig
impl UnsafeUnpin for EncryptionConfig
impl UnwindSafe for EncryptionConfig
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