org.pdfbox.pdmodel.encryption
Class SecurityHandlersManager
java.lang.Object
org.pdfbox.pdmodel.encryption.SecurityHandlersManager
public class SecurityHandlersManager
extends java.lang.Object
This class 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.
- Benoit Guillon (benoit.guillon@snv.jussieu.fr)
getInstance
public static SecurityHandlersManager getInstance()
Get the singleton instance.
- The SecurityHandlersManager.
getSecurityHandler
public SecurityHandler getSecurityHandler(String filterName)
throws BadSecurityHandlerException
Retrieve the appropriate SecurityHandler for a the given filter name.
The filter name is an entry of the encryption dictionary of an encrypted document.
filterName
- The filter name.
- The appropriate SecurityHandler if it exists.
registerHandler
public void registerHandler(String filterName,
Class securityHandlerClass,
Class protectionPolicyClass)
throws BadSecurityHandlerException
register 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
filterName
- The name of the filter.securityHandlerClass
- Security Handler class to register.protectionPolicyClass
- Protection Policy class to register.