PDFEncryption (Apache FOP 2.7 API)
Date: 2022-01-12

org.apache.fop.pdf

## Interface PDFEncryption

- All Known Implementing Classes:
    PDFEncryptionJCE

      public interface PDFEncryption

  This interface defines the contract for classes implementing PDF encryption.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `applyFilter(AbstractPDFStream stream)` 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.
    `Version` | `getPDFVersion()` Returns the PDF version required by the current encryption algorithm.
    `java.lang.String` | `getTrailerEntry()` Returns the /Encrypt entry in the file trailer dictionary.

- - ### Method Detail

    - #### 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

          java.lang.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

Copyright 1999-2022 The Apache Software Foundation. All Rights Reserved.