}
PdfArray ocspArray = dictionary.getAsArray(PdfName.OCSPS);
ArrayList<BasicOCSPResp> ocsps = new ArrayList<BasicOCSPResp>();
if (ocspArray != null) {
for (int i = 0; i < ocspArray.size(); i++) {
PRStream stream = (PRStream) ocspArray.getAsStream(i);
OCSPResp response = new OCSPResp(PdfReader.getStreamBytes(stream));
BasicOCSPResp basicResponse = (BasicOCSPResp) response.getResponseObject();
ocsps.add(basicResponse);
}
}
PdfArray crlArray = dictionary.getAsArray(PdfName.CRLS);
ArrayList<X509CRL> crls = new ArrayList<X509CRL>();
if (crlArray != null) {
for (int i = 0; i < crlArray.size(); i++) {
PRStream stream = (PRStream) crlArray.getAsStream(i);
X509CRL crl = (X509CRL) factory.generateCRL(new ByteArrayInputStream(PdfReader.getStreamBytes(stream)));
crls.add(crl);
}
}
if (ocsps.size() == 0 && crls.size() == 0) {