Per-Entry Attributes of JAR Manifest File

Q

What are per-entry attributes of a JAR manifest file?

✍: FYIcenter.com

A

Per-entry attributes of a JAR manifest file are attributes associated to each individual entry in the JAR file. Per-entry attributes are specified in separate sections, one section per entry. Main attributes fall into the following different groups:

1. Attribute for File Content:

  • Content-Type: This attribute can be used to specify the MIME type and subtype of data for a specific file entry in the JAR file.

2. Attributes for Package:

  • Implementation-Title: The value is a string that defines the title of the extension implementation.
  • Implementation-Version: The value is a string that defines the version of the extension implementation.
  • Implementation-Vendor: The value is a string that defines the organization that maintains the extension implementation.
  • Implementation-Vendor-Id: The value is a string id that uniquely defines the organization that maintains the extension implementation.
  • Implementation-URL: This attribute defines the URL from which the extension implementation can be downloaded from.
  • Specification-Title: The value is a string that defines the title of the extension specification.
  • Specification-Version: The value is a string that defines the version of the extension specification.
  • Specification-Vendor: The value is a string that defines the organization that maintains the extension specification.
  • Sealed: This attribute defines whether this JAR file is sealed or not. The value can be either "true" or "false", case is ignored. If it is set to "true", then all the packages in the JAR file are defaulted to be sealed, unless they are defined otherwise individually.

3. Attribute for Beans Objects:

  • Java-Bean: Defines whether the specific jar file entry is a Java Beans object or not. The value should be either "true" or "false", case is ignored.

4. Attributes for Signing:

  • x-Digest-y: The name of this attribute specifies the name of the digest algorithm used to compute the digest value for the corresponding jar file entry. The value of this attribute stores the actual digest value. The prefix 'x' specifies the algorithm name and the optional suffix 'y' indicates to which language the digest value should be verified against.
  • Magic: This is an optional attribute that can be used by applications to indicate how verifier should compute the digest value contained in the manifest entry. The value of this attribute is a set of comma separated context specific strings. Detailed description is here.

Here is a sample of two per-entry sections of a JAR manifest file:

...

Name: javax/activation/MimeTypeParseException.class
SHA1-Digest: lE5grROfW1qsYZdtOlB7SOrtlRU=

Name: javax/activation/CommandInfo.class
SHA1-Digest: pl22Lz5hCL9DxzbXDiAYGov6BtI=

Back to FAQ on JAR (Java ARchive) File Format.

2016-04-15, 2163🔥, 0💬