public static boolean verifyCertificate(X509Certificate signedCert,X509Certificate signingCert) throws CryptoException {
  try {
    signedCert.verify(signingCert.getPublicKey());
    return true;
  }
 catch (  InvalidKeyException ex) {
    return false;
  }
catch (  SignatureException ex) {
    return false;
  }
catch (  NoSuchProviderException ex) {
    throw new CryptoException(res.getString("NoVerifyCertificate.exception.message"),ex);
  }
catch (  NoSuchAlgorithmException ex) {
    throw new CryptoException(res.getString("NoVerifyCertificate.exception.message"),ex);
  }
catch (  CertificateException ex) {
    throw new CryptoException(res.getString("NoVerifyCertificate.exception.message"),ex);
  }
}

public static boolean verifyCertificate ( X509Certificate signedCert , X509Certificate signingCert ) throws CryptoException { try { signedCert . verify ( signingCert . getPublicKey ( ) ) ; return true ; } catch ( InvalidKeyException ex ) { return false ; } catch ( SignatureException ex ) { return false ; } catch ( NoSuchProviderException ex ) { throw new CryptoException ( res . getString ( "NoVerifyCertificate.exception.message" ) , ex ) ; } catch ( NoSuchAlgorithmException ex ) { throw new CryptoException ( res . getString ( "NoVerifyCertificate.exception.message" ) , ex ) ; } catch ( CertificateException ex ) { throw new CryptoException ( res . getString ( "NoVerifyCertificate.exception.message" ) , ex ) ; } }
verify that one x . 509 certificate was signed using the private key that corresponds to the public key of a second certificate .
