Skip to main content

Module parser

Module parser 

Source

Enums§

PdfCredential
Caller-supplied credential for opening an encrypted PDF. Standard security handlers authenticate by password; the public-key handler (/Filter /Adobe.PubSec) authenticates by an X.509 certificate plus its RSA private key. For unencrypted PDFs the credential is ignored (the empty Password(b"") is the natural default).

Functions§

parse_pdf
Parses an unencrypted PDF, or an encrypted PDF whose user password is empty. For encrypted PDFs that require a user- or owner-supplied password, use parse_pdf_with_password; for /Filter /Adobe.PubSec PDFs, use parse_pdf_with_certificate.
parse_pdf_with_certificate
Parses an Adobe.PubSec-encrypted PDF using a recipient X.509 certificate (DER) and its matching PKCS#8 private key (DER). Returns PdfError::InvalidPassword when no recipient blob in the PDF unwraps with the supplied private key. For password-encrypted or unencrypted documents this returns PdfError::Unsupported — use parse_pdf_with_password / parse_pdf respectively.
parse_pdf_with_credential
Generic entry point that accepts either credential variant. The password and certificate wrappers above thread their arguments through this function.
parse_pdf_with_password
Parses an encrypted PDF with a caller-supplied password. The password is tried first as the user password, then as the owner password; if neither authenticates, the function returns PdfError::InvalidPassword. For unencrypted documents the password is ignored.