Class StandardSecurityHandler


  • public class StandardSecurityHandler
    extends Object
    Class represents standard security handler. It authenticates user password and calculates encryption key for document.
    Author:
    Sergey Shemyakov
    • Constructor Detail

      • StandardSecurityHandler

        public StandardSecurityHandler​(PDEncryption pdEncryption,
                                       COSObject id,
                                       COSDocument document)
        Constructor.
        Parameters:
        pdEncryption - is encryption object of this PDF document.
        id - is ID object from document trailer.
        document - is COSDocument object associated with this security handler
    • Method Detail

      • authenticateEmptyPassword

        public Boolean authenticateEmptyPassword()
        Checks if empty string is a user password to this PDF document and sets encryption key if password is successfully checked.
        Returns:
        true if empty string is a password to this PDF document.
      • getEncryptionKey

        public byte[] getEncryptionKey()
        Returns:
        encryption key for this security handler. If empty string is not a valid password returns null.
      • isEmptyStringPassword

        public boolean isEmptyStringPassword()
        Returns:
        true if empty string is a valid password for this PDF document.
      • getPdEncryption

        public PDEncryption getPdEncryption()
        Returns:
        PDEncryption of this security handler.