Package com.pd4ml.pdf.cos.security
Class PdfEncryptor
- java.lang.Object
-
- com.pd4ml.pdf.cos.security.PdfEncryptor
-
public final class PdfEncryptor extends java.lang.ObjectEncrypts an in-memoryCOSDocumentfor output, using the PDF Standard security handler -- the write-side counterpart ofStandardSecurityHandler(a reader, which deliberately doesn't expose a forward/encrypting direction). Lives in this package to reuse the package-privateRC4/AES/LegacyKeyDerivation/AES256KeyDerivationprimitives, the same way the test suite'sEncryptedPdfSampleBuilderdoes -- this class generalizes that same math to walk an arbitrary already-built document's whole object graph instead of a fixed tiny fixture.Call this on a fully-built, still-plaintext
COSDocument(e.g. acom.pd4ml.pdf.mergemerge target) after all content is in place but before handing it to a writer -- every string and stream reachable from the document's indirect objects is encrypted in place, and a fresh/Encryptdictionary plus/IDare registered on the document.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPdfEncryptor.Algorithmstatic classPdfEncryptor.Options
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidencrypt(COSDocument document, PdfEncryptor.Options options)
-
-
-
Method Detail
-
encrypt
public static void encrypt(COSDocument document, PdfEncryptor.Options options) throws COSSecurityException
- Throws:
COSSecurityException
-
-