code: private void verifySignature(X509Certificate cert)
          throws CertPathValidatorException
      {
          String msg = "signature";
          if (debug != null)
              debug.println("---checking " + msg + "...");
  
          try {
              if (sigProvider != null) {
                  cert.verify(prevPubKey, sigProvider);
              } else {
                  cert.verify(prevPubKey);
              }
          } catch (SignatureException e) {
              throw new CertPathValidatorException
                  (msg + " check failed", e, null, -1,
                   BasicReason.INVALID_SIGNATURE);
          } catch (GeneralSecurityException e) {
              throw new CertPathValidatorException(msg + " check failed", e);
          }
  
          if (debug != null)
              debug.println(msg + " verified.");
      }
docs: Verifies the signature on the certificate using the previous public key.
  
  @param cert the X509Certificate
  @throws CertPathValidatorException if certificate does not verify