Interface SecurityManager


  • public interface SecurityManager

    Manages security handlers for a PDF document.

    Use this interface to add, or find and dispatch, a security handler for use with a PDF document.

    Different documents may use different Security Handlers. A single document may use multiple Security Handlers that implement different crypt filters. Under these conditions the Security Manager must be defined to select the appropriate Security Handler.

    Depending on the implementation, an instance of a Security Manager may be document-specific, or not.

    This class is useful only for new (that is, custom) implementations of Security Handlers and SecurityKey/Lock. Its default functionality is provided by the PDF Java Toolkit.

    Note: Generally, separate Security Managers must be used for encryption and decryption. However, the Security Manager for decryption can be used for both, decryption and encryption.

    • Method Detail

      • getSecurityHandler

        SecurityHandler getSecurityHandler​(java.lang.String filterName,
                                           java.util.Map encryptParams)
                                    throws PDFSecurityConfigurationException
        Get the security handler specified by the parameters.
        Parameters:
        filterName - the PDF name of the security handler.
        encryptParams - Map that represents the content of the PDF document's Encrypt dictionary.
        Returns:
        SecurityHandler object that implements the requested security handler.
        Throws:
        PDFSecurityConfigurationException - if the appropriate security handler cannot be found.
      • addSecurityHandler

        void addSecurityHandler​(java.lang.String name,
                                SecurityHandler handler)
        Add a new security handler to the list of security handlers supported by this security manager.
        Parameters:
        name - the PDF name of the security handler.
        handler - SecurityHandler object.