Class SecurityHandlerFactory
java.lang.Object
org.apache.pdfbox.pdmodel.encryption.SecurityHandlerFactory
Manages security handlers for the application.
It follows the singleton pattern.
To be usable, security managers must be registered in it.
Security managers are retrieved by the application when necessary.
- Author:
- Benoit Guillon, John Hewson
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionReturns a new security handler for the given Filter name, or null none is available.Returns a new security handler for the given protection policy, or null none is available.void
registerHandler
(String name, Class<? extends SecurityHandler> securityHandler, Class<? extends ProtectionPolicy> protectionPolicy) Registers a security handler.
-
Field Details
-
INSTANCE
Singleton instance
-
-
Method Details
-
registerHandler
public void registerHandler(String name, Class<? extends SecurityHandler> securityHandler, Class<? extends ProtectionPolicy> protectionPolicy) Registers a security handler. If the security handler was already registered an exception is thrown. If another handler was previously registered for the same filter name or for the same policy name, an exception is thrown- Parameters:
name
- the name of the filtersecurityHandler
- security handler class to registerprotectionPolicy
- protection policy class to register
-
newSecurityHandlerForPolicy
Returns a new security handler for the given protection policy, or null none is available.- Parameters:
policy
- the protection policy for which to create a security handler- Returns:
- a new SecurityHandler instance, or null if none is available
-
newSecurityHandlerForFilter
Returns a new security handler for the given Filter name, or null none is available.- Parameters:
name
- the Filter name from the PDF encryption dictionary- Returns:
- a new SecurityHandler instance, or null if none is available
-