|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jarify.JarVerifier
public final class JarVerifier
Verfies the authencity of a signed jar file.
Field Summary | |
---|---|
private java.util.Hashtable |
aliasSBF
Contains the signature block file (as PKCS#7) for each alias |
private java.util.Hashtable |
digestCache
Contains all loaded Digest Class objects for caching purposes |
private JAPCertificate |
m_certRoot
The trusted certificate |
private JarFile |
m_jarFile
The JarFile to authenticate to |
private JarManifest |
m_Manifest
The Manifest File of the JarFile |
Constructor Summary | |
---|---|
private |
JarVerifier(java.io.File jarFile)
Constructor |
Method Summary | |
---|---|
private void |
close()
|
private org.bouncycastle.crypto.Digest |
getDigestClass(java.lang.String digestID)
This method retrieves the digest class for the given digest name and tries to instanciate an object of this digest class. |
private java.util.Vector |
InitAliases(java.util.Vector aliases)
Initializes the aliasSBF Hashtable and removes the aliases which cannot be authenticated by the given root certificate. |
private boolean |
isSignedJar()
Checks whether the jarFile is a signed one. |
static boolean |
verify(java.io.File file,
JAPCertificate cert)
|
private boolean |
verify(JAPCertificate cert)
Verify the signature of the jarFile with the supplied certificate. |
private boolean |
verifyManifestDigests()
Verifies the digests in the manifest file to the digests calculated against the corresponding file. |
private boolean |
verifySFDigests(java.lang.String alias)
Verifies the digests within the SF file against the digests computed of the entries in the manifest file. Verifies the digest in the SF file against the digest computed from the entire manifest file. |
private boolean |
verifySignature(java.lang.String alias)
Checks the Signature File against the Signature Block File from the given alias. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private JarFile m_jarFile
private JarManifest m_Manifest
private JAPCertificate m_certRoot
private java.util.Hashtable digestCache
private java.util.Hashtable aliasSBF
Constructor Detail |
---|
private JarVerifier(java.io.File jarFile) throws java.util.zip.ZipException, java.io.IOException, java.lang.SecurityException
jarFilePath
- the JarFile to verify
java.util.zip.ZipException
java.io.IOException
java.lang.SecurityException
Method Detail |
---|
private void close()
private java.util.Vector InitAliases(java.util.Vector aliases)
aliases
- All aliases from the Jarfile.
public static boolean verify(java.io.File file, JAPCertificate cert)
private boolean verify(JAPCertificate cert)
cert
- Path to the certificate
private boolean verifySignature(java.lang.String alias)
alias
- The entity whose signature(s) should be tested
private boolean isSignedJar()
Checks in particular:
- if Manifest file exists
- if at least one Signature file exists
- if at least one Signature Block file for each SF exists
private boolean verifySFDigests(java.lang.String alias)
alias
- Specfies the signature file for the given alias
private boolean verifyManifestDigests()
private org.bouncycastle.crypto.Digest getDigestClass(java.lang.String digestID)
digestID
- The name of the digest, e.g. 'SHA1-Digest'
JarConstants
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |