public bool VerifyResponse(BasicOcspResp ocspResp, X509Certificate responderCert)
{
// testing using the responder certificate
if (IsSignatureValid(ocspResp, responderCert))
return true;
// testing using trusted anchors
if (certificates == null)
return false;
try {
// loop over the certificates in the root store
foreach (X509Certificate anchor in certificates) {
try {
if (IsSignatureValid(ocspResp, anchor))
return true;
} catch (GeneralSecurityException) {}
}
}
catch (GeneralSecurityException) {
return false;
}
return false;
}