pub struct StandardSecurityHandler { /* private fields */ }Implementations§
Source§impl StandardSecurityHandler
impl StandardSecurityHandler
Sourcepub fn open(
encrypt_dict: &PdfDictionary,
id_first: &[u8],
password: &[u8],
) -> PdfResult<Option<Self>>
pub fn open( encrypt_dict: &PdfDictionary, id_first: &[u8], password: &[u8], ) -> PdfResult<Option<Self>>
Builds a decryption handler from the /Encrypt dictionary and the
trailer’s first /ID string, authenticating the supplied password.
Returns None if the password does not authenticate.
Sourcepub fn from_file_key(
file_key: Vec<u8>,
string_method: CryptMethod,
stream_method: CryptMethod,
encrypt_metadata: bool,
) -> Self
pub fn from_file_key( file_key: Vec<u8>, string_method: CryptMethod, stream_method: CryptMethod, encrypt_metadata: bool, ) -> Self
Builds a handler from an externally-derived file key and the
pre-resolved crypt methods. Used by credential paths that derive
the file key out-of-band — the public-key handler unwraps the
file key from a CMS recipient envelope and then constructs the
handler via this entry point rather than open.
Sourcepub fn encrypts_metadata(&self) -> bool
pub fn encrypts_metadata(&self) -> bool
Returns true when this handler was configured with
/EncryptMetadata false. Parser uses this to skip
/Type /Metadata streams.
Sourcepub fn decrypt_bytes(
&self,
bytes: &[u8],
object_ref: ObjectRef,
kind: BytesKind,
) -> PdfResult<Vec<u8>>
pub fn decrypt_bytes( &self, bytes: &[u8], object_ref: ObjectRef, kind: BytesKind, ) -> PdfResult<Vec<u8>>
Decrypts bytes produced for the indirect object (num, gen).
The crypt method is chosen per kind — strings use /StrF,
streams use /StmF. Returns the ciphertext unchanged for
/Identity filters; returns an error for malformed AES input
(wrong length, bad PKCS#7 padding).
Trait Implementations§
Source§impl Clone for StandardSecurityHandler
impl Clone for StandardSecurityHandler
Source§fn clone(&self) -> StandardSecurityHandler
fn clone(&self) -> StandardSecurityHandler
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more