public final class JARVerifier
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
JARVerifier.VerifierException
An Exception thrown during verification.
|
Constructor and Description |
---|
JARVerifier(java.security.cert.X509Certificate[] trustedCaCerts)
Create a JAR verifier with an array of trusted certificate authority certificates.
|
Modifier and Type | Method and Description |
---|---|
static JARVerifier |
create(java.lang.String keystore,
java.lang.String alias,
char[] passwd) |
void |
verifySingleJarFile(java.util.jar.JarFile jf)
Verify the JAR file signatures with the trusted CA certificates.
|
public JARVerifier(java.security.cert.X509Certificate[] trustedCaCerts)
trustedCaCerts
- certspublic static JARVerifier create(java.lang.String keystore, java.lang.String alias, char[] passwd) throws java.io.IOException, java.security.KeyStoreException, java.security.NoSuchAlgorithmException, java.security.cert.CertificateException
keystore
- filepath to the keystorealias
- alias name of the cert chain to verify withpasswd
- password to use to verify the keystore, or nulljava.io.IOException
- on io errorjava.security.KeyStoreException
- key store errorjava.security.NoSuchAlgorithmException
- algorithm missingjava.security.cert.CertificateException
- cert errorpublic final void verifySingleJarFile(java.util.jar.JarFile jf) throws java.io.IOException, java.security.cert.CertificateException, JARVerifier.VerifierException
jf
- jar filejava.io.IOException
- on io errorjava.security.cert.CertificateException
- on cert errorJARVerifier.VerifierException
- If the jar file cannot be verified.