// Path: src/main/java/net/klakegg/pkix/ocsp/builder/BuildHandler.java
// public interface BuildHandler<T> {
// 
//     T build(Properties properties);
// 
// }
// 
// Path: src/main/java/net/klakegg/pkix/ocsp/builder/Builder.java
// public class Builder<T> {
// 
//     protected BuildHandler<T> buildHandler;
// 
//     protected Map<Property<?>, Object> map = new HashMap<>();
// 
//     public Builder(BuildHandler<T> buildHandler) {
//         this(buildHandler, new HashMap<Property<?>, Object>());
//     }
// 
//     private Builder(BuildHandler<T> buildHandler, Map<Property<?>, Object> map) {
//         this.buildHandler = buildHandler;
//         this.map = map;
//     }
// 
//     public <S> Builder<T> set(Property<S> property, S value) {
//         Map<Property<?>, Object> map = new HashMap<>(this.map);
//         map.put(property, value);
// 
//         return new Builder<>(buildHandler, map);
//     }
// 
//     public T build() {
//         return buildHandler.build(new Properties(map));
//     }
// }
// 
// Path: src/main/java/net/klakegg/pkix/ocsp/builder/Properties.java
// public class Properties {
// 
//     private Map<Property<?>, Object> map;
// 
//     protected Properties(Map<Property<?>, Object> map) {
//         this.map = map;
//     }
// 
//     @SuppressWarnings("unchecked")
//     public <S> S get(Property<S> property) {
//         return map.containsKey(property) ? (S) map.get(property) : property.getDefaultValue();
//     }
// }


import net.klakegg.pkix.ocsp.builder.BuildHandler;
import net.klakegg.pkix.ocsp.builder.Builder;
import net.klakegg.pkix.ocsp.builder.Properties;
import java.math.BigInteger;
import java.net.URI;
import java.security.cert.X509Certificate;
        X509Certificate issuer = findIntermediate(certificates[0]);

        return verify(CertificateIssuer.generate(issuer), certificates);
    }

    public OcspResult verify(CertificateIssuer issuer, X509Certificate... certificates) throws OcspException {
        if (certificates.length == 0)
            return OcspResult.EMPTY;

        URI uri = properties.get(OVERRIDE_URL);

        if (uri == null) {
            uri = detectOcspUri(certificates[0]);

            // In case no URI was detected.
            if (uri == null)
                return OcspResult.EMPTY;
        }

        BigInteger[] serialNumbers = new BigInteger[certificates.length];
        for (int i = 0; i < certificates.length; i++)
            serialNumbers[i] = certificates[i].getSerialNumber();

        return verify(uri, issuer, serialNumbers);
    }

    public OcspResult verify(URI uri, CertificateIssuer issuer, BigInteger... serialNumbers) throws OcspException {
        OcspRequest request = new OcspRequest();
        request.setIssuer(issuer);
        request.addCertificates(serialNumbers);
// Path: src/main/java/net/klakegg/pkix/ocsp/builder/BuildHandler.java
// public interface BuildHandler<T> {
// 
//     T build(Properties properties);
// 
// }
// 
// Path: src/main/java/net/klakegg/pkix/ocsp/builder/Builder.java
// public class Builder<T> {
// 
//     protected BuildHandler<T> buildHandler;
// 
//     protected Map<Property<?>, Object> map = new HashMap<>();
// 
//     public Builder(BuildHandler<T> buildHandler) {
//         this(buildHandler, new HashMap<Property<?>, Object>());
//     }
// 
//     private Builder(BuildHandler<T> buildHandler, Map<Property<?>, Object> map) {
//         this.buildHandler = buildHandler;
//         this.map = map;
//     }
// 
//     public <S> Builder<T> set(Property<S> property, S value) {
//         Map<Property<?>, Object> map = new HashMap<>(this.map);
//         map.put(property, value);
// 
//         return new Builder<>(buildHandler, map);
//     }
// 
//     public T build() {
//         return buildHandler.build(new Properties(map));
//     }
// }
// 
// Path: src/main/java/net/klakegg/pkix/ocsp/builder/Properties.java
// public class Properties {
// 
//     private Map<Property<?>, Object> map;
// 
//     protected Properties(Map<Property<?>, Object> map) {
//         this.map = map;
//     }
// 
//     @SuppressWarnings("unchecked")
//     public <S> S get(Property<S> property) {
//         return map.containsKey(property) ? (S) map.get(property) : property.getDefaultValue();
//     }
// }


// Path: src/main/java/net/klakegg/pkix/ocsp/OcspMultiClient.java
import net.klakegg.pkix.ocsp.builder.BuildHandler;
import net.klakegg.pkix.ocsp.builder.Builder;
import net.klakegg.pkix.ocsp.builder.Properties;
import java.math.BigInteger;
import java.net.URI;
import java.security.cert.X509Certificate;

        X509Certificate issuer = findIntermediate(certificates[0]);

        return verify(CertificateIssuer.generate(issuer), certificates);
    }

    public OcspResult verify(CertificateIssuer issuer, X509Certificate... certificates) throws OcspException {
        if (certificates.length == 0)
            return OcspResult.EMPTY;

        URI uri = properties.get(OVERRIDE_URL);

        if (uri == null) {
            uri = detectOcspUri(certificates[0]);

            // In case no URI was detected.
            if (uri == null)
                return OcspResult.EMPTY;
        }

        BigInteger[] serialNumbers = new BigInteger[certificates.length];
        for (int i = 0; i < certificates.length; i++)
            serialNumbers[i] = certificates[i].getSerialNumber();

        return verify(uri, issuer, serialNumbers);
    }

    public OcspResult verify(URI uri, CertificateIssuer issuer, BigInteger... serialNumbers) throws OcspException {
        OcspRequest request = new OcspRequest();
        request.setIssuer(issuer);
        request.addCertificates(serialNumbers);
        if (properties.get(NONCE))