org.apache.poi.hslf.record

## Class DocumentEncryptionAtom

- java.lang.Object
- - org.apache.poi.hslf.record.Record
  - - org.apache.poi.hslf.record.RecordAtom
    - - org.apache.poi.hslf.record.PositionDependentRecordAtom
      - - org.apache.poi.hslf.record.DocumentEncryptionAtom

- All Implemented Interfaces:
    GenericRecord, PositionDependentRecord

      public final class DocumentEncryptionAtom
      extends PositionDependentRecordAtom

  A Document Encryption Atom (type 12052). Holds information on the Encryption of a Document
  Author:
    Nick Burch

- - ### Field Summary

    - ### Fields inherited from class org.apache.poi.hslf.record.Record

      `logger`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `` | `DocumentEncryptionAtom()`
    `protected` | `DocumentEncryptionAtom(byte[] source, int start, int len)` For the Document Encryption Atom

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `EncryptionInfo` | `getEncryptionInfo()`
    `java.lang.String` | `getEncryptionProviderName()` Return the name of the encryption provider used
    `java.util.Map<java.lang.String,java.util.function.Supplier<?>>` | `getGenericProperties()`
    `int` | `getKeyLength()` Return the length of the encryption key, in bits
    `long` | `getRecordType()` We are of type 12052
    `void` | `initializeEncryptionInfo(int keyBits)` Initializes the encryption settings
    `void` | `updateOtherRecordReferences(java.util.Map<java.lang.Integer,java.lang.Integer> oldToNewReferencesLookup)` Offer the record the list of records that have changed their location as part of the writeout.
    `void` | `writeOut(java.io.OutputStream out)` Write the contents of the record back, so it can be written to disk

    - ### Methods inherited from class org.apache.poi.hslf.record.PositionDependentRecordAtom

      `getLastOnDiskOffset, setLastOnDiskOffset`

    - ### Methods inherited from class org.apache.poi.hslf.record.RecordAtom

      `getChildRecords, isAnAtom`

    - ### Methods inherited from class org.apache.poi.hslf.record.Record

      `buildRecordAtOffset, createRecordForType, findChildRecords, getGenericChildren, getGenericRecordType, writeLittleEndian, writeLittleEndian`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DocumentEncryptionAtom

          protected DocumentEncryptionAtom(byte[] source,
                                           int start,
                                           int len)

      For the Document Encryption Atom

    - #### DocumentEncryptionAtom

          public DocumentEncryptionAtom()

  - ### Method Detail

    - #### initializeEncryptionInfo

          public void initializeEncryptionInfo(int keyBits)

      Initializes the encryption settings
      Parameters:
        `keyBits` - see `CipherAlgorithm.rc4` for allowed values, use -1 for default size

    - #### getKeyLength

          public int getKeyLength()

      Return the length of the encryption key, in bits

    - #### getEncryptionProviderName

          public java.lang.String getEncryptionProviderName()

      Return the name of the encryption provider used

    - #### getEncryptionInfo

          public EncryptionInfo getEncryptionInfo()

      Returns:
        the `EncryptionInfo` object for details about encryption settings

    - #### getRecordType

          public long getRecordType()

      We are of type 12052
      Specified by:
        `getRecordType` in class `Record`

    - #### writeOut

          public void writeOut(java.io.OutputStream out)
                        throws java.io.IOException

      Write the contents of the record back, so it can be written to disk
      Specified by:
        `writeOut` in class `Record`
      Throws:
        `java.io.IOException`

    - #### updateOtherRecordReferences

          public void updateOtherRecordReferences(java.util.Map<java.lang.Integer,java.lang.Integer> oldToNewReferencesLookup)

      Description copied from class: `PositionDependentRecordAtom`
      Offer the record the list of records that have changed their location as part of the writeout. Allows records to update their internal pointers to other records locations
      Specified by:
        `updateOtherRecordReferences` in interface `PositionDependentRecord`
      Specified by:
        `updateOtherRecordReferences` in class `PositionDependentRecordAtom`

    - #### getGenericProperties

          public java.util.Map<java.lang.String,java.util.function.Supplier<?>> getGenericProperties()

Copyright 2020 The Apache Software Foundation or its licensors, as applicable.