public final class PDFEncryptionJCE extends PDFObject implements PDFEncryption
Modifier and Type | Method and Description |
---|---|
void |
applyFilter(AbstractPDFStream stream)
Adds a PDFFilter to the PDFStream object
|
byte[] |
encrypt(byte[] data,
PDFObject refObj)
Encrypt an array of bytes using a reference PDFObject for calculating
the encryption key.
|
Version |
getPDFVersion()
Returns the PDF version required by the current encryption algorithm.
|
String |
getTrailerEntry()
Returns the /Encrypt entry in the file trailer dictionary.
|
static PDFEncryption |
make(PDFObjectNumber objectNumber,
PDFEncryptionParams params,
PDFDocument pdf)
Creates and returns an encryption object.
|
boolean |
supportsObjectStream() |
byte[] |
toPDF()
Prepares the encryption dictionary for output to a PDF file.
|
contentEquals, encode, encodeBinaryToHexString, encodeString, encodeText, formatObject, getChildren, getDocument, getDocumentSafely, getGeneration, getObjectID, getObjectNumber, getParent, hasObjectNumber, makeReference, output, outputInline, referencePDF, setDocument, setObjectNumber, setObjectNumber, setObjectNumber, setParent, toPDFString
public static PDFEncryption make(PDFObjectNumber objectNumber, PDFEncryptionParams params, PDFDocument pdf)
objectNumber
- the object number for the encryption dictionaryparams
- the encryption parameterspdf
- the PDF document to be encryptedpublic byte[] encrypt(byte[] data, PDFObject refObj)
encrypt
in interface PDFEncryption
data
- data to encryptrefObj
- reference PDFObjectpublic void applyFilter(AbstractPDFStream stream)
applyFilter
in interface PDFEncryption
stream
- the stream to add an encryption filter topublic byte[] toPDF()
public String getTrailerEntry()
getTrailerEntry
in interface PDFEncryption
public Version getPDFVersion()
getPDFVersion
in interface PDFEncryption
public boolean supportsObjectStream()
supportsObjectStream
in class PDFObject
Copyright © 2025 Apache Software Foundation. All rights reserved.