Class PDFEncryptor


  • public class PDFEncryptor
    extends PDFSecurityHandler
    The PDFEncyptor is a subclass of PDFSecurityHandler that is used to encrypt strings and streams for pdf output.
    • Constructor Detail

      • PDFEncryptor

        public PDFEncryptor​(byte[] fileID,
                            java.lang.String ownerP,
                            java.lang.String userP,
                            int permissionFlags)
        Creates a new new PDF encryptor. Both the owner and user passwords are optional.
    • Method Detail

      • getEncryptionDict

        public java.util.Map getEncryptionDict()
        Returns the encryption dictionary.
      • startEncrypt

        public void startEncrypt​(int oNum,
                                 int gNum)
        Encryption of strings and streams use the object number and generation number as part of the encryption algorithm. For strings inside other objects, the object & generation number used are the ones for the enclosing object. When an object from the xref table is output, it calls startEncrypt() to save away these numbers so all objects inside the xref object will use the right values.
      • encryptString

        public byte[] encryptString​(java.lang.String s)
        Returns the contents of the pdf string, encrypted
      • encryptBytes

        public byte[] encryptBytes​(byte[] aBuffer)
        Returns a new copy of the input buffer, encrypted.