Class SecurityHandlerFactory


  • public final class SecurityHandlerFactory
    extends java.lang.Object
    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
    • Method Detail

      • registerHandler

        public void registerHandler​(java.lang.String name,
                                    java.lang.Class<? extends SecurityHandler> securityHandler,
                                    java.lang.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 filter
        securityHandler - security handler class to register
        protectionPolicy - protection policy class to register
      • newSecurityHandlerForPolicy

        public SecurityHandler<ProtectionPolicy> newSecurityHandlerForPolicy​(ProtectionPolicy policy)
        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

        public SecurityHandler<ProtectionPolicy> newSecurityHandlerForFilter​(java.lang.String name)
        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