Package org.apache.fop.pdf
Class PDFEncryptionManager
java.lang.Object
org.apache.fop.pdf.PDFEncryptionManager
This class acts as a factory for PDF encryption support. It enables the
feature to be optional to FOP depending on the availability of JCE.
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanChecks whether the necessary algorithms are available.static booleanIndicates whether JCE is available.static PDFEncryptionnewInstance(PDFEncryptionParams params, PDFDocument pdf) Creates a new PDFEncryption instance if PDF encryption is available.static voidsetupPDFEncryption(PDFEncryptionParams params, PDFDocument pdf) Sets up PDF encryption if PDF encryption is requested by registering aPDFEncryptionParamsobject with the user agent and if the necessary cryptographic support is available.
-
Method Details
-
isJCEAvailable
public static boolean isJCEAvailable()Indicates whether JCE is available.- Returns:
- boolean true if JCE is present
-
checkAvailableAlgorithms
public static boolean checkAvailableAlgorithms()Checks whether the necessary algorithms are available.- Returns:
- boolean True if all necessary algorithms are present
-
setupPDFEncryption
Sets up PDF encryption if PDF encryption is requested by registering aPDFEncryptionParamsobject with the user agent and if the necessary cryptographic support is available.- Parameters:
params- the PDF encryption params or null to disable encryptionpdf- the PDF document to setup encryption for
-
newInstance
Creates a new PDFEncryption instance if PDF encryption is available.- Parameters:
params- PDF encryption parameterspdf- the PDF document to encrypt- Returns:
- PDFEncryption the newly created instance, null if PDF encryption is unavailable.
-