Class JARVerifier

    • 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JARVerifier

        public JARVerifier​(java.security.cert.X509Certificate[] trustedCaCerts)
        Create a JAR verifier with an array of trusted certificate authority certificates.
        Parameters:
        trustedCaCerts - certs
    • 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 keystore
        alias - alias name of the cert chain to verify with
        passwd - 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 error
        java.security.KeyStoreException - key store error
        java.security.NoSuchAlgorithmException - algorithm missing
        java.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 error
        java.security.cert.CertificateException - on cert error
        JARVerifier.VerifierException - If the jar file cannot be verified.