/** * Return the signed content of the document. This is not a PDF file, nor is it the PDF file * before signing, it is the byte sequence made of the input minus the area where the signature * bytes will be. See "The ByteRange and signature value" in the document * <a href="https://www.adobe.com/devnet-docs/acrobatetk/tools/DigSig/Acrobat_DigitalSignatures_in_PDF.pdf#page=5">Digital * Signatures in a PDF</a>. * * @param pdfFile The signed pdf file as byte array * @return a byte array containing only the signed part of the content * @throws IOException if the pdfFile can't be read */ public byte[] getSignedContent(byte[] pdfFile) throws IOException { try (COSFilterInputStream fis = new COSFilterInputStream(pdfFile, getByteRange())) { return fis.toByteArray(); } }
/** * Return the signed content of the document. This is not a PDF file, nor is it the PDF file * before signing, it is the byte sequence made of the input minus the area where the signature * bytes will be. See "The ByteRange and signature value" in the document * <a href="https://www.adobe.com/devnet-docs/acrobatetk/tools/DigSig/Acrobat_DigitalSignatures_in_PDF.pdf#page=5">Digital * Signatures in a PDF</a>. * * @param pdfFile The signed pdf file as InputStream * @return a byte array containing only the signed part of the content * @throws IOException if the pdfFile can't be read */ public byte[] getSignedContent(InputStream pdfFile) throws IOException { try (COSFilterInputStream fis = new COSFilterInputStream(pdfFile, getByteRange())) { return fis.toByteArray(); } }
/** * Return the signed content of the document. This is not a PDF file, nor is it the PDF file * before signing, it is the byte sequence made of the input minus the area where the signature * bytes will be. See "The ByteRange and signature value" in the document * <a href="https://www.adobe.com/devnet-docs/acrobatetk/tools/DigSig/Acrobat_DigitalSignatures_in_PDF.pdf#page=5">Digital * Signatures in a PDF</a>. * * @param pdfFile The signed pdf file as InputStream * @return a byte array containing only the signed part of the content * @throws IOException if the pdfFile can't be read */ public byte[] getSignedContent(InputStream pdfFile) throws IOException { try (COSFilterInputStream fis = new COSFilterInputStream(pdfFile, getByteRange())) { return fis.toByteArray(); } }
/** * Return the signed content of the document. This is not a PDF file, nor is it the PDF file * before signing, it is the byte sequence made of the input minus the area where the signature * bytes will be. See "The ByteRange and signature value" in the document * <a href="https://www.adobe.com/devnet-docs/acrobatetk/tools/DigSig/Acrobat_DigitalSignatures_in_PDF.pdf#page=5">Digital * Signatures in a PDF</a>. * * @param pdfFile The signed pdf file as byte array * @return a byte array containing only the signed part of the content * @throws IOException if the pdfFile can't be read */ public byte[] getSignedContent(byte[] pdfFile) throws IOException { try (COSFilterInputStream fis = new COSFilterInputStream(pdfFile, getByteRange())) { return fis.toByteArray(); } }
/** * Return the signed content of the document. This is not a PDF file, nor is it the PDF file * before signing, it is the byte sequence made of the input minus the area where the signature * bytes will be. See "The ByteRange and signature value" in the document * <a href="https://www.adobe.com/devnet-docs/acrobatetk/tools/DigSig/Acrobat_DigitalSignatures_in_PDF.pdf#page=5">Digital * Signatures in a PDF</a>. * * @param pdfFile The signed pdf file as InputStream * @return a byte array containing only the signed part of the content * @throws IOException if the pdfFile can't be read */ public byte[] getSignedContent(InputStream pdfFile) throws IOException { COSFilterInputStream fis=null; try { fis = new COSFilterInputStream(pdfFile,getByteRange()); return fis.toByteArray(); } finally { if (fis != null) { fis.close(); } } }
/** * Return the signed content of the document. This is not a PDF file, nor is it the PDF file * before signing, it is the byte sequence made of the input minus the area where the signature * bytes will be. See "The ByteRange and signature value" in the document * <a href="https://www.adobe.com/devnet-docs/acrobatetk/tools/DigSig/Acrobat_DigitalSignatures_in_PDF.pdf#page=5">Digital * Signatures in a PDF</a>. * * @param pdfFile The signed pdf file as byte array * @return a byte array containing only the signed part of the content * @throws IOException if the pdfFile can't be read */ public byte[] getSignedContent(byte[] pdfFile) throws IOException { COSFilterInputStream fis=null; try { fis = new COSFilterInputStream(pdfFile,getByteRange()); return fis.toByteArray(); } finally { if (fis != null) { fis.close(); } } }