@Override public int getNumberOfComponents() { return (int) ((PdfArray)getPdfObject()).getAsStream(1).getAsInt(PdfName.N); }
/** * Gets a list of X509CRL objects from a Document Security Store. * @return a list of CRLs * @throws GeneralSecurityException * @throws IOException */ public List<X509CRL> getCRLsFromDSS() throws GeneralSecurityException, IOException { List<X509CRL> crls = new ArrayList<>(); if (dss == null) return crls; PdfArray crlarray = dss.getAsArray(PdfName.CRLs); if (crlarray == null) return crls; for (int i = 0; i < crlarray.size(); i++) { PdfStream stream = crlarray.getAsStream(i); crls.add((X509CRL) SignUtils.parseCrlFromStream(new ByteArrayInputStream(stream.getBytes()))); } return crls; }
/** * Gets a list of X509CRL objects from a Document Security Store. * @return a list of CRLs * @throws GeneralSecurityException * @throws IOException */ public List<X509CRL> getCRLsFromDSS() throws GeneralSecurityException, IOException { List<X509CRL> crls = new ArrayList<>(); if (dss == null) return crls; PdfArray crlarray = dss.getAsArray(PdfName.CRLs); if (crlarray == null) return crls; for (int i = 0; i < crlarray.size(); i++) { PdfStream stream = crlarray.getAsStream(i); crls.add((X509CRL) SignUtils.parseCrlFromStream(new ByteArrayInputStream(stream.getBytes()))); } return crls; }
/** * Gets OCSP responses from the Document Security Store. * @return a list of BasicOCSPResp objects * @throws IOException * @throws GeneralSecurityException */ public List<BasicOCSPResp> getOCSPResponsesFromDSS() throws IOException, GeneralSecurityException { List<BasicOCSPResp> ocsps = new ArrayList<>(); if (dss == null) return ocsps; PdfArray ocsparray = dss.getAsArray(PdfName.OCSPs); if (ocsparray == null) return ocsps; for (int i = 0; i < ocsparray.size(); i++) { PdfStream stream = ocsparray.getAsStream(i); OCSPResp ocspResponse = new OCSPResp(stream.getBytes()); if (ocspResponse.getStatus() == 0) try { ocsps.add((BasicOCSPResp) ocspResponse.getResponseObject()); } catch (OCSPException e) { throw new GeneralSecurityException(e.toString()); } } return ocsps; }
/** * Gets OCSP responses from the Document Security Store. * @return a list of BasicOCSPResp objects * @throws IOException * @throws GeneralSecurityException */ public List<BasicOCSPResp> getOCSPResponsesFromDSS() throws IOException, GeneralSecurityException { List<BasicOCSPResp> ocsps = new ArrayList<>(); if (dss == null) return ocsps; PdfArray ocsparray = dss.getAsArray(PdfName.OCSPs); if (ocsparray == null) return ocsps; for (int i = 0; i < ocsparray.size(); i++) { PdfStream stream = ocsparray.getAsStream(i); OCSPResp ocspResponse = new OCSPResp(stream.getBytes()); if (ocspResponse.getStatus() == 0) try { ocsps.add((BasicOCSPResp) ocspResponse.getResponseObject()); } catch (OCSPException e) { throw new GeneralSecurityException(e.toString()); } } return ocsps; }
byte[] iccBytes = ((PdfArray) colorSpace.getPdfObject()).getAsStream(1).getBytes(); if (ICC_COLOR_SPACE_CMYK.equals(IccProfile.getIccColorSpaceName(iccBytes))) { if ((boolean) fill) {
byte[] iccBytes = ((PdfArray) colorSpace.getPdfObject()).getAsStream(1).getBytes(); if (ICC_COLOR_SPACE_CMYK.equals(IccProfile.getIccColorSpaceName(iccBytes))) { if ((boolean) fill) {