code: public static String getOCSPURL(X509Certificate certificate) throws CertificateParsingException {
          try {
              ASN1Primitive obj = getExtensionValue(certificate, Extension.authorityInfoAccess.getId());
              if (obj == null) {
                  return null;
              }
              
              ASN1Sequence AccessDescriptions = (ASN1Sequence) obj;
              for (int i = 0; i < AccessDescriptions.size(); i++) {
                  ASN1Sequence AccessDescription = (ASN1Sequence) AccessDescriptions.getObjectAt(i);
                  if ( AccessDescription.size() != 2 ) {
                      continue;
                  } else {
                      if ((AccessDescription.getObjectAt(0) instanceof ASN1ObjectIdentifier) && ((ASN1ObjectIdentifier)AccessDescription.getObjectAt(0)).getId().equals("1.3.6.1.5.5.7.48.1")) {
                          String AccessLocation =  getStringFromGeneralName((ASN1Primitive)AccessDescription.getObjectAt(1));
                          if ( AccessLocation == null ) {
                              return "" ;
                          } else {
                              return AccessLocation ;
                          }
                      }
                  }
              }
          } catch (Exception e)  {
          }
          return null;
      }
docs: Retrieves the OCSP URL from the given certificate.
  @param certificate the certificate
  @return the URL or null
  @throws CertificateParsingException on error
  @since	2.1.6