use super::{PdfEncryptionAlgorithm, PdfPermissions};
pub struct PdfEncryption {
pub user_password: String,
pub owner_password: String,
pub algorithm: PdfEncryptionAlgorithm,
pub permissions: PdfPermissions,
}
impl PdfEncryption {
pub fn new(user: impl Into<String>, owner: impl Into<String>) -> Self {
Self {
user_password: user.into(),
owner_password: owner.into(),
algorithm: PdfEncryptionAlgorithm::Aes256,
permissions: PdfPermissions::all(),
}
}
#[must_use]
pub fn with_algorithm(mut self, algorithm: PdfEncryptionAlgorithm) -> Self {
self.algorithm = algorithm;
self
}
#[must_use]
pub fn with_permissions(mut self, permissions: PdfPermissions) -> Self {
self.permissions = permissions;
self
}
}