Class StandardHandlerUsingStandard40

Direct Known Subclasses:
StandardHandlerUsingStandard128

public class StandardHandlerUsingStandard40 extends StandardSecurityHandler
  • Field Details

    • pad

      protected static final byte[] pad
    • metadataPad

      protected static final byte[] metadataPad
    • documentId

      protected byte[] documentId
    • keyLength

      protected int keyLength
    • arcfour

      protected ARCFOUREncryption arcfour
    • DEFAULT_KEY_LENGTH

      private static final int DEFAULT_KEY_LENGTH
      See Also:
  • Constructor Details

    • StandardHandlerUsingStandard40

      public StandardHandlerUsingStandard40(PdfDictionary encryptionDictionary, byte[] userPassword, byte[] ownerPassword, int permissions, boolean encryptMetadata, boolean embeddedFilesOnly, byte[] documentId)
    • StandardHandlerUsingStandard40

      public StandardHandlerUsingStandard40(PdfDictionary encryptionDictionary, byte[] password, byte[] documentId, boolean encryptMetadata)
  • Method Details

    • getEncryptionStream

      public OutputStreamEncryption getEncryptionStream(OutputStream os)
      Specified by:
      getEncryptionStream in class SecurityHandler
    • getDecryptor

      public IDecryptor getDecryptor()
      Specified by:
      getDecryptor in class SecurityHandler
    • computeUserPassword

      public byte[] computeUserPassword(byte[] ownerPassword, PdfDictionary encryptionDictionary)
    • calculatePermissions

      protected void calculatePermissions(int permissions)
    • computeOwnerKey

      protected byte[] computeOwnerKey(byte[] userPad, byte[] ownerPad)
    • computeGlobalEncryptionKey

      protected void computeGlobalEncryptionKey(byte[] userPad, byte[] ownerKey, boolean encryptMetadata)
    • computeUserKey

      protected byte[] computeUserKey()
    • setSpecificHandlerDicEntries

      protected void setSpecificHandlerDicEntries(PdfDictionary encryptionDictionary, boolean encryptMetadata, boolean embeddedFilesOnly)
    • isValidPassword

      protected boolean isValidPassword(byte[] uValue, byte[] userKey)
    • initKeyAndFillDictionary

      private void initKeyAndFillDictionary(PdfDictionary encryptionDictionary, byte[] userPassword, byte[] ownerPassword, int permissions, boolean encryptMetadata, boolean embeddedFilesOnly, byte[] documentId)
    • initKeyAndReadDictionary

      private void initKeyAndReadDictionary(PdfDictionary encryptionDictionary, byte[] password, byte[] documentId, boolean encryptMetadata)
    • checkPassword

      private void checkPassword(boolean encryptMetadata, byte[] uValue, byte[] oValue, byte[] paddedPassword)
    • padPassword

      private byte[] padPassword(byte[] password)
    • getKeyLength

      private int getKeyLength(PdfDictionary encryptionDict)