public static boolean verifyOcspCertificates(BasicOCSPResp ocsp, KeyStore keystore, String provider) {
        if (provider == null)
            provider = "BC";
        try {
            for (Enumeration aliases = keystore.aliases(); aliases.hasMoreElements();) {
                try {
                    String alias = (String)aliases.nextElement();
                    if (!keystore.isCertificateEntry(alias))
                        continue;
                    X509Certificate certStoreX509 = (X509Certificate)keystore.getCertificate(alias);
                    if (ocsp.isSignatureValid(new JcaContentVerifierProviderBuilder().setProvider(provider).build(certStoreX509.getPublicKey())))
                        return true;
                }
                catch (Exception ex) {
                }
            }
        }
        catch (Exception e) {
        }
        return false;
    }
public static boolean verifyOcspCertificates ( BasicOCSPResp ocsp , KeyStore keystore , String provider ) { if ( provider == null ) provider = "BC" ; try { for ( Enumeration aliases = keystore . aliases ( ) ; aliases . hasMoreElements ( ) ; ) { try { String alias = ( String ) aliases . nextElement ( ) ; if ( ! keystore . isCertificateEntry ( alias ) ) continue ; X509Certificate certStoreX509 = ( X509Certificate ) keystore . getCertificate ( alias ) ; if ( ocsp . isSignatureValid ( new JcaContentVerifierProviderBuilder ( ) . setProvider ( provider ) . build ( certStoreX509 . getPublicKey ( ) ) ) ) return true ; } catch ( Exception ex ) { } } } catch ( Exception e ) { } return false ; }
Verifies an OCSP response against a KeyStore.
@param ocsp the OCSP response
@param keystore the <CODE>KeyStore</CODE>
@param provider the provider or <CODE>null</CODE> to use the BouncyCastle provider
@return <CODE>true</CODE> is a certificate was found
@since	2.1.6