Interface PDFEncryption

All Known Implementing Classes:
PDFEncryptionJCE

public interface PDFEncryption
This interface defines the contract for classes implementing PDF encryption.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Adds a PDFFilter to the PDFStream object
    byte[]
    encrypt(byte[] data, PDFObject refObj)
    Encrypt an array of bytes using a reference PDFObject for calculating the encryption key.
    Returns the PDF version required by the current encryption algorithm.
    Returns the /Encrypt entry in the file trailer dictionary.
  • Method Details

    • applyFilter

      void applyFilter(AbstractPDFStream stream)
      Adds a PDFFilter to the PDFStream object
      Parameters:
      stream - the stream to add an encryption filter to
    • encrypt

      byte[] encrypt(byte[] data, PDFObject refObj)
      Encrypt an array of bytes using a reference PDFObject for calculating the encryption key.
      Parameters:
      data - data to encrypt
      refObj - reference PDFObject
      Returns:
      byte[] the encrypted data
    • getTrailerEntry

      String getTrailerEntry()
      Returns the /Encrypt entry in the file trailer dictionary.
      Returns:
      the string "/Encrypt n g R\n" where n and g are the number and generation of the document's encryption dictionary
    • getPDFVersion

      Version getPDFVersion()
      Returns the PDF version required by the current encryption algorithm.
      Returns:
      the PDF Version