APIdia Launch Partner
Top Description Inners Fields Constructors Methods
sun.security.util

public Class ManifestEntryVerifier

extends Object
Class Inheritance
Imports
java.io.IOException, java.security.*, java.util.*, java.util.jar.*, sun.security.jca.Providers

This class is used to verify each entry in a jar file with its manifest value.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
ManifestEntryVerifier.SunProviderHolder

Holder class to lazily load Sun provider.

Field Summary

Modifier and TypeField and Description
pack-priv HashMap<String, MessageDigest>
createdDigests

the created digest objects

private static final Debug
pack-priv ArrayList<MessageDigest>
digests

the digests in use for a given entry

private JarEntry
private final Manifest
private final String
pack-priv ArrayList<byte[]>
manifestHashes

the manifest hashes for the digests in use

private String
private CodeSigner[]
private boolean

Constructor Summary

AccessConstructor and Description
public
ManifestEntryVerifier(Manifest man, String manifestFileName)

Create a new ManifestEntryVerifier object.

Method Summary

Modifier and TypeMethod and Description
private static Map<String, Boolean>
private boolean
public JarEntry
getEntry()

get the JarEntry for this object

public void
setEntry(String name, JarEntry entry)

Find the hashes in the manifest for this entry, save them, and set the MessageDigest objects to calculate the hashes on the fly.

public void
update(byte buffer)

update the digests for the digests we are interested in

public void
update(byte[] buffer, int off, int len)

update the digests for the digests we are interested in

public CodeSigner[]
verify(Hashtable<String, CodeSigner[]> verifiedSigners, Hashtable<String, CodeSigner[]> sigFileSigners, Map<CodeSigner[], Map<String, Boolean>> signersToAlgs)

go through all the digests, calculating the final digest and comparing it to the one in the manifest.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

createdDigestsback to summary
pack-priv HashMap<String, MessageDigest> createdDigests

the created digest objects

debugback to summary
private static final Debug debug
digestsback to summary
pack-priv ArrayList<MessageDigest> digests

the digests in use for a given entry

entryback to summary
private JarEntry entry
manback to summary
private final Manifest man
manifestFileNameback to summary
private final String manifestFileName
manifestHashesback to summary
pack-priv ArrayList<byte[]> manifestHashes

the manifest hashes for the digests in use

nameback to summary
private String name
signersback to summary
private CodeSigner[] signers
skipback to summary
private boolean skip

Constructor Detail

ManifestEntryVerifierback to summary
public ManifestEntryVerifier(Manifest man, String manifestFileName)

Create a new ManifestEntryVerifier object.

Method Detail

algsPermittedStatusForSignersback to summary
private static Map<String, Boolean> algsPermittedStatusForSigners(Map<CodeSigner[], Map<String, Boolean>> signersToAlgs, CodeSigner[] signers)
checkConstraintsback to summary
private boolean checkConstraints(String algorithm, JarConstraintsParameters params)
getEntryback to summary
public JarEntry getEntry()

get the JarEntry for this object

setEntryback to summary
public void setEntry(String name, JarEntry entry) throws IOException

Find the hashes in the manifest for this entry, save them, and set the MessageDigest objects to calculate the hashes on the fly. If name is null it signifies that update/verify should ignore this entry.

updateback to summary
public void update(byte buffer)

update the digests for the digests we are interested in

updateback to summary
public void update(byte[] buffer, int off, int len)

update the digests for the digests we are interested in

verifyback to summary
public CodeSigner[] verify(Hashtable<String, CodeSigner[]> verifiedSigners, Hashtable<String, CodeSigner[]> sigFileSigners, Map<CodeSigner[], Map<String, Boolean>> signersToAlgs) throws JarException

go through all the digests, calculating the final digest and comparing it to the one in the manifest. If this is the first time we have verified this object, remove its code signers from sigFileSigners and place in verifiedSigners.

sun.security.util back to summary

private Class ManifestEntryVerifier.SunProviderHolder

extends Object
Class Inheritance

Holder class to lazily load Sun provider.

Note

if Providers.getSunProvider returned a cached provider, we could avoid the need for caching the provider with this holder class; we should try to revisit this in JDK 8.

Field Summary

Modifier and TypeField and Description
private static final Provider

Constructor Summary

AccessConstructor and Description
private

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

instanceback to summary
private static final Provider instance

Constructor Detail

SunProviderHolderback to summary
private SunProviderHolder()