Package com.dtolabs.rundeck.core.utils
Class JARVerifier
- java.lang.Object
-
- com.dtolabs.rundeck.core.utils.JARVerifier
-
public final class JARVerifier extends java.lang.Object
JARVerifier verifies signed JAR files given a list of trusted CA certificates. See http://java.sun.com/products/jce/doc/guide/HowToImplAProvider.html#MutualAuth
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
JARVerifier.VerifierException
An Exception thrown during verification.
-
Constructor Summary
Constructors Constructor Description JARVerifier(java.security.cert.X509Certificate[] trustedCaCerts)
Create a JAR verifier with an array of trusted certificate authority certificates.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method 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.
-
-
-
Method Detail
-
create
public 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
- Parameters:
keystore
- filepath to the keystorealias
- alias name of the cert chain to verify withpasswd
- password to use to verify the keystore, or null- Returns:
- Construct a JARVerifier with a keystore and alias and password.
- Throws:
java.io.IOException
- on io errorjava.security.KeyStoreException
- key store errorjava.security.NoSuchAlgorithmException
- algorithm missingjava.security.cert.CertificateException
- cert error
-
verifySingleJarFile
public final void verifySingleJarFile(java.util.jar.JarFile jf) throws java.io.IOException, java.security.cert.CertificateException, JARVerifier.VerifierException
Verify the JAR file signatures with the trusted CA certificates.- Parameters:
jf
- jar file- Throws:
java.io.IOException
- on io errorjava.security.cert.CertificateException
- on cert errorJARVerifier.VerifierException
- If the jar file cannot be verified.
-
-