pub struct SecurityState {
pub encrypt_dict: EncryptionDict,
pub file_id: Vec<u8>,
pub file_key: Option<Vec<u8>>,
pub string_method: CryptMethod,
pub stream_method: CryptMethod,
pub encrypt_obj_num: Option<u32>,
}Expand description
Security state held by PdfDocument after encryption detection.
Fields§
§encrypt_dict: EncryptionDictThe parsed encryption dictionary.
file_id: Vec<u8>The file ID (/ID array first element) from the trailer.
file_key: Option<Vec<u8>>The file encryption key (set after successful authentication).
string_method: CryptMethodCrypt method used for strings.
stream_method: CryptMethodCrypt method used for streams.
encrypt_obj_num: Option<u32>Object number of the encryption dictionary (to skip decryption).
Implementations§
Source§impl SecurityState
impl SecurityState
Sourcepub fn new(
encrypt_dict: EncryptionDict,
file_id: Vec<u8>,
encrypt_obj_num: Option<u32>,
) -> Self
pub fn new( encrypt_dict: EncryptionDict, file_id: Vec<u8>, encrypt_obj_num: Option<u32>, ) -> Self
Create from encryption dict and file ID, determining crypt methods.
Sourcepub fn is_authenticated(&self) -> bool
pub fn is_authenticated(&self) -> bool
Whether authentication has succeeded.
Sourcepub fn permissions(&self) -> Permissions
pub fn permissions(&self) -> Permissions
Get permissions.
Trait Implementations§
Source§impl Clone for SecurityState
impl Clone for SecurityState
Source§fn clone(&self) -> SecurityState
fn clone(&self) -> SecurityState
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 SecurityState
impl RefUnwindSafe for SecurityState
impl Send for SecurityState
impl Sync for SecurityState
impl Unpin for SecurityState
impl UnsafeUnpin for SecurityState
impl UnwindSafe for SecurityState
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