pub struct EncryptionState { /* private fields */ }Expand description
Encryption parameters extracted from the Encrypt dict.
Implementations§
Source§impl EncryptionState
impl EncryptionState
Sourcepub fn try_open(
encrypt_dict: &PdfDict,
trailer: &PdfDict,
file_id: &[u8],
) -> Result<Self, PdfError>
pub fn try_open( encrypt_dict: &PdfDict, trailer: &PdfDict, file_id: &[u8], ) -> Result<Self, PdfError>
Try to decrypt with an empty user password.
Equivalent to try_open_with_password(..., b"").
Returns Err(PdfError::PasswordRequired) if the empty password
does not match; callers that want to try a user-supplied password
should use Self::try_open_with_password instead.
Sourcepub fn try_open_with_password(
encrypt_dict: &PdfDict,
_trailer: &PdfDict,
file_id: &[u8],
password: &[u8],
) -> Result<Self, PdfError>
pub fn try_open_with_password( encrypt_dict: &PdfDict, _trailer: &PdfDict, file_id: &[u8], password: &[u8], ) -> Result<Self, PdfError>
Try to decrypt with the given user password.
Returns Ok(state) on success and
Err(PdfError::PasswordRequired) when the password doesn’t match.
Auto Trait Implementations§
impl Freeze for EncryptionState
impl RefUnwindSafe for EncryptionState
impl Send for EncryptionState
impl Sync for EncryptionState
impl Unpin for EncryptionState
impl UnsafeUnpin for EncryptionState
impl UnwindSafe for EncryptionState
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> 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