All Known Subinterfaces:
SecurityLockPasswordInterface, SecurityLockPKIInterface

public interface SecurityLock
Provides the functionality to (optionally) encrypt a PDFDocument at full save time.

SecurityLock is composed of three attributes:

  • Security Manager for encryption
  • Encryption Parameters Map
  • Requested permissions

Each of these attributes is represented by an object of an appropriate type. Different implementations of the SecurityLock instantiate these attributes according to the rules of specific implementations.

Use SecurityKey.getSecurityManager() to decrypt the document.

  • Method Summary

    Modifier and Type
    Method
    Description
    Get the encryption parameters map used for encryption.
    Return the Security Manager that contains Security Handlers used to encrypt a PDF document.
    void
    setEncryptParameters(Map encryptParams)
    Set the encryption parameter map that reflects the content of the /Encrypt dictionary used to encrypt a PDF document.
    boolean
    Determine whether the saved PDF document should be encrypted.
  • Method Details

    • getSecurityManager

      SecurityManager getSecurityManager()
      Return the Security Manager that contains Security Handlers used to encrypt a PDF document.

      Returns:
      a SecurityManager object. May return null.
    • setEncryptParameters

      void setEncryptParameters(Map encryptParams)
      Set the encryption parameter map that reflects the content of the /Encrypt dictionary used to encrypt a PDF document.

      This Map uses the following correspondence between PDF Types and Java Objects:

      CosBooleanBoolean
      CosNumericNumber
      CosNameString
      CosStringByte array
      CosArrayArrayList
      CosDictionaryHashMap
      Parameters:
      encryptParams - the encryption parameters.
    • shouldEncrypt

      boolean shouldEncrypt()
      Determine whether the saved PDF document should be encrypted. The absence of encryption is one of the encryption choices. This method tells the user of the security lock implementation whether the saved PDF document should be encrypted.
      Returns:
      true if this document should be encrypted; false, otherwise.
    • getEncryptParameters

      Map getEncryptParameters()
      Get the encryption parameters map used for encryption.

      This Map uses the same correspondence between PDF Types and Java Objects as in the setEncryptParameters(Map) method.

      Returns:
      a Map that contains encryption parameters. May return null.