Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

gnu.classpath.tools.jarsigner
Class JarVerifier  view JarVerifier download JarVerifier.java

java.lang.Object
  extended bygnu.classpath.tools.jarsigner.JarVerifier

public class JarVerifier
extends java.lang.Object

The JAR verification handler of the gjarsigner tool.


Field Summary
private  java.util.Map entryHashes
          Map of jar entry names to their hash.
private  java.util.jar.JarFile jarFile
          The JAR file to verify.
private static java.util.logging.Logger log
           
private  Main main
          The owner tool of this handler.
private  HashUtils util
           
 
Constructor Summary
(package private) JarVerifier(Main main)
           
 
Method Summary
private  java.lang.String getEntryHash(java.lang.String entryName)
           
(package private)  void start()
           
private  boolean verifyManifest(java.lang.String hash)
           
private  boolean verifySF(java.lang.String sigFileName)
           
private  boolean verifySFEntries(java.lang.String alias)
          This method is called after at least one signer (usually a key-store alias name) was found to be trusted; i.e.
private  boolean verifySFEntry(java.lang.String name, java.lang.String hash)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static final java.util.logging.Logger log

main

private Main main
The owner tool of this handler.


util

private HashUtils util

jarFile

private java.util.jar.JarFile jarFile
The JAR file to verify.


entryHashes

private java.util.Map entryHashes
Map of jar entry names to their hash.

Constructor Detail

JarVerifier

JarVerifier(Main main)
Method Detail

start

void start()
     throws java.lang.Exception

verifySF

private boolean verifySF(java.lang.String sigFileName)
                  throws java.security.cert.CRLException,
                         java.security.cert.CertificateException,
                         java.util.zip.ZipException,
                         java.io.IOException

verifySFEntries

private boolean verifySFEntries(java.lang.String alias)
                         throws java.io.IOException
This method is called after at least one signer (usually a key-store alias name) was found to be trusted; i.e. his/her signature block in the corresponding .DSA file was successfully verified using his/her public key.

This method, uses the contents of the corresponding .SF file to compute and verify the hashes of the manifest entries in the JAR file.


verifyManifest

private boolean verifyManifest(java.lang.String hash)
                        throws java.io.IOException

verifySFEntry

private boolean verifySFEntry(java.lang.String name,
                              java.lang.String hash)
                       throws java.io.IOException

getEntryHash

private java.lang.String getEntryHash(java.lang.String entryName)
                               throws java.io.IOException