java.util.jar
Class JarVerifier

java.lang.Object
  extended byjava.util.jar.JarVerifier

class JarVerifier
extends Object

Author:
Roland Schemers

Nested Class Summary
(package private) static class JarVerifier.VerifierStream
           
 
Field Summary
private  boolean anyToVerify
           
private  ByteArrayOutputStream baos
           
private  ArrayList certCache
           
(package private) static sun.security.util.Debug debug
           
private  sun.security.util.ManifestDigester manDig
          The ManifestDigester object
private  Manifest manifest
           
(package private)  byte[] manifestRawBytes
          the bytes for the manDig object
private  boolean parsingBlockOrSF
           
private  boolean parsingMeta
           
private  ArrayList pendingBlocks
          "queue" of pending PKCS7 blocks that we couldn't parse until we parsed the .SF file
private  Hashtable sigFileCerts
           
private  Hashtable sigFileData
           
private  Hashtable verifiedCerts
           
 
Constructor Summary
JarVerifier(Manifest manifest, byte[] rawBytes)
           
 
Method Summary
 void beginEntry(JarEntry je, sun.security.util.ManifestEntryVerifier mev)
          This method scans to see which entry we're parsing and keeps various state information depending on what type of file is being parsed.
(package private)  void doneWithMeta()
          called to let us know we have processed all the META-INF entries, and if we re-read one of them, don't re-process it.
 java.security.cert.Certificate[] getCerts(String name)
          return an array of java.security.cert.Certificate objects for the given file in the jar. this array is not cloned.
(package private)  boolean nothingToVerify()
          returns true if there no files to verify.
private  void processEntry(sun.security.util.ManifestEntryVerifier mev)
          called when we reach the end of entry in one of the read() methods.
 void update(int n, byte[] b, int off, int len, sun.security.util.ManifestEntryVerifier mev)
          update an array of bytes.
 void update(int b, sun.security.util.ManifestEntryVerifier mev)
          update a single byte.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debug

static final sun.security.util.Debug debug

verifiedCerts

private Hashtable verifiedCerts

sigFileCerts

private Hashtable sigFileCerts

sigFileData

private Hashtable sigFileData

pendingBlocks

private ArrayList pendingBlocks
"queue" of pending PKCS7 blocks that we couldn't parse until we parsed the .SF file


certCache

private ArrayList certCache

parsingBlockOrSF

private boolean parsingBlockOrSF

parsingMeta

private boolean parsingMeta

anyToVerify

private boolean anyToVerify

manifest

private Manifest manifest

baos

private ByteArrayOutputStream baos

manDig

private sun.security.util.ManifestDigester manDig
The ManifestDigester object


manifestRawBytes

byte[] manifestRawBytes
the bytes for the manDig object

Constructor Detail

JarVerifier

public JarVerifier(Manifest manifest,
                   byte[] rawBytes)
Method Detail

beginEntry

public void beginEntry(JarEntry je,
                       sun.security.util.ManifestEntryVerifier mev)
                throws IOException
This method scans to see which entry we're parsing and keeps various state information depending on what type of file is being parsed.

Throws:
IOException

update

public void update(int b,
                   sun.security.util.ManifestEntryVerifier mev)
            throws IOException
update a single byte.

Throws:
IOException

update

public void update(int n,
                   byte[] b,
                   int off,
                   int len,
                   sun.security.util.ManifestEntryVerifier mev)
            throws IOException
update an array of bytes.

Throws:
IOException

processEntry

private void processEntry(sun.security.util.ManifestEntryVerifier mev)
                   throws IOException
called when we reach the end of entry in one of the read() methods.

Throws:
IOException

getCerts

public java.security.cert.Certificate[] getCerts(String name)
return an array of java.security.cert.Certificate objects for the given file in the jar. this array is not cloned.


nothingToVerify

boolean nothingToVerify()
returns true if there no files to verify. should only be called after all the META-INF entries have been processed.


doneWithMeta

void doneWithMeta()
called to let us know we have processed all the META-INF entries, and if we re-read one of them, don't re-process it. Also gets rid of any data structures we needed when parsing META-INF entries.