Class HSLFSlideShowEncrypted

java.lang.Object
org.apache.poi.hslf.usermodel.HSLFSlideShowEncrypted
All Implemented Interfaces:
Closeable, AutoCloseable

@Internal public class HSLFSlideShowEncrypted extends Object implements Closeable
This class provides helper functions for encrypted PowerPoint documents.
  • Constructor Details

    • HSLFSlideShowEncrypted

      protected HSLFSlideShowEncrypted(DocumentEncryptionAtom dea)
    • HSLFSlideShowEncrypted

      protected HSLFSlideShowEncrypted(byte[] docstream, NavigableMap<Integer,Record> recordMap)
    • HSLFSlideShowEncrypted

      protected HSLFSlideShowEncrypted(byte[] docstream, NavigableMap<Integer,Record> recordMap, char[] password)
      Parameters:
      docstream -
      recordMap -
      password - in char array format (can be null)
      Since:
      6.0.0
  • Method Details

    • getDocumentEncryptionAtom

      public DocumentEncryptionAtom getDocumentEncryptionAtom()
    • getEncryptionInfo

      protected EncryptionInfo getEncryptionInfo()
    • encryptRecord

      protected OutputStream encryptRecord(OutputStream plainStream, int persistId, Record record)
    • decryptRecord

      protected void decryptRecord(byte[] docstream, int persistId, int offset)
    • decryptPicture

      protected void decryptPicture(byte[] pictstream, int offset)
    • encryptPicture

      protected void encryptPicture(byte[] pictstream, int offset)
    • updateEncryptionRecord

      protected Record[] updateEncryptionRecord(Record[] records, char[] password)
      Updates the encryption record for the given records using the supplied password. If password is null any existing encryption record is removed (decrypted output).
      Parameters:
      records - the current record array
      password - the output password, or null to remove encryption
      Returns:
      the updated record array
      Since:
      6.0.0
    • updateEncryptionRecord

      protected Record[] updateEncryptionRecord(Record[] records)
      Updates the encryption record for the given records, reading the password from Biff8EncryptionKey.getCurrentUserPassword().
      Parameters:
      records - the current record array
      Returns:
      the updated record array
    • normalizeRecords

      protected static Record[] normalizeRecords(Record[] records)
      remove duplicated UserEditAtoms and merge PersistPtrHolder. Before this method is called, make sure that the offsets are correct, i.e. call HSLFSlideShowImpl.updateAndWriteDependantRecords(OutputStream, Map)
    • removeEncryptionRecord

      protected static Record[] removeEncryptionRecord(Record[] records)
    • addEncryptionRecord

      protected static Record[] addEncryptionRecord(Record[] records, DocumentEncryptionAtom dea)
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException