Package org.apache.commons.compress.archivers.zip

# Class X0015_CertificateIdForFile

java.lang.Object
org.apache.commons.compress.archivers.zip.PKWareExtraHeader
org.apache.commons.compress.archivers.zip.X0015_CertificateIdForFile

All Implemented Interfaces:
  `ZipExtraField`

public class X0015_CertificateIdForFile extends PKWareExtraHeader
X.509 Certificate ID and Signature for individual file (0x0015).

This field contains the information about which certificate in the PKCS#7 store was used to sign a particular file. It also contains the signature data. This field can appear multiple times, but can only appear once per certificate.

Note: all fields stored in Intel low-byte/high-byte order.

             Value     Size     Description
             -----     ----     -----------
     (CID)   0x0015    2 bytes  Tag for this "extra" block type
             TSize     2 bytes  Size of data that follows
             RCount    4 bytes  Number of recipients. (inferred)
             HashAlg   2 bytes  Hash algorithm identifier. (inferred)
             TData     TSize    Signature Data

Since:
  1.11
This class is not thread-safe

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class org.apache.commons.compress.archivers.zip.PKWareExtraHeader

  `PKWareExtraHeader.EncryptionAlgorithm, PKWareExtraHeader.HashAlgorithm`

- ## Field Summary

  ### Fields inherited from interface org.apache.commons.compress.archivers.zip.ZipExtraField

  `EXTRAFIELD_HEADER_SIZE`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `X0015_CertificateIdForFile()`
  Constructs a new instance.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `PKWareExtraHeader.HashAlgorithm`
  `getHashAlgorithm()`
  Gets hash algorithm.
  `int`
  `getRecordCount()`
  Gets record count.
  `void`
  `parseFromCentralDirectoryData(byte[] data, int offset, int length)`
  Populate data from this array as if it was in central directory data.

  ### Methods inherited from class org.apache.commons.compress.archivers.zip.PKWareExtraHeader

  `assertMinimalLength, getCentralDirectoryData, getCentralDirectoryLength, getHeaderId, getLocalFileDataData, getLocalFileDataLength, parseFromLocalFileData, setCentralDirectoryData, setLocalFileDataData`

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

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

- ## Constructor Details

  - ### X0015_CertificateIdForFile

    public X0015_CertificateIdForFile()
    Constructs a new instance.

- ## Method Details

  - ### getHashAlgorithm

    public PKWareExtraHeader.HashAlgorithm getHashAlgorithm()
    Gets hash algorithm.
    Returns:
      the hash algorithm

  - ### getRecordCount

    public int getRecordCount()
    Gets record count.
    Returns:
      the record count

  - ### parseFromCentralDirectoryData

    public void parseFromCentralDirectoryData(byte[] data, int offset, int length) throws ZipException
    Description copied from interface: `ZipExtraField`
    Populate data from this array as if it was in central directory data.
    Specified by:
      `parseFromCentralDirectoryData` in interface `ZipExtraField`
    Overrides:
      `parseFromCentralDirectoryData` in class `PKWareExtraHeader`
    Parameters:
      `data` - the array of bytes.
      `offset` - the source location in the data array.
      `length` - the number of bytes to use in the data array.
    Throws:
      `ZipException` - on error
    See Also:
      - `ZipExtraField.parseFromCentralDirectoryData(byte[], int, int)`