Package eu.europa.esig.dss.pades
Class PAdESUtils
java.lang.Object
eu.europa.esig.dss.pades.PAdESUtils
public final class PAdESUtils extends Object
Utils for dealing with PAdES
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_FIRST_PAGEDefines a number of a first page in a document -
Method Summary
Modifier and Type Method Description static InMemoryDocumentgetOriginalPDF(PAdESSignature padesSignature)Returns the original signed content for thepadesSignaturestatic InMemoryDocumentgetOriginalPDF(PdfCMSRevision pdfRevision)Returns the original signed content for thepdfRevisionstatic RevocationInfoArchivalgetRevocationInfoArchival(org.bouncycastle.asn1.ASN1Encodable encodable)ReturnsRevocationInfoArchivalfrom the given encodablestatic byte[]getSignedContent(DSSDocument dssDocument, ByteRange byteRange)Returns a signed content according to the provided byteRangestatic booleanisPDFDocument(DSSDocument document)Checks if the givenDSSDocumentrepresents a PDF documentstatic InMemoryDocumentretrievePreviousPDFRevision(DSSDocument document, ByteRange byteRange)Retrieves the PDF document up to the previous PDF Revision, an empty document if such revision is not found
-
Field Details
-
DEFAULT_FIRST_PAGE
public static final int DEFAULT_FIRST_PAGEDefines a number of a first page in a document- See Also:
- Constant Field Values
-
-
Method Details
-
getOriginalPDF
Returns the original signed content for thepadesSignature- Parameters:
padesSignature-PAdESSignature- Returns:
InMemoryDocument
-
getOriginalPDF
Returns the original signed content for thepdfRevision- Parameters:
pdfRevision-PdfRevision- Returns:
InMemoryDocument
-
retrievePreviousPDFRevision
public static InMemoryDocument retrievePreviousPDFRevision(DSSDocument document, ByteRange byteRange)Retrieves the PDF document up to the previous PDF Revision, an empty document if such revision is not found- Parameters:
document-DSSDocumentthe original documentbyteRange-ByteRangerepresenting the signed revision, to get the previous covered PDF for- Returns:
InMemoryDocumentthe PDF document up to the signed revision
-
getSignedContent
public static byte[] getSignedContent(DSSDocument dssDocument, ByteRange byteRange) throws IOExceptionReturns a signed content according to the provided byteRange- Parameters:
dssDocument-DSSDocumentto extract the content frombyteRange-ByteRangeindicating which content range should be extracted- Returns:
- extracted content
- Throws:
IOException- in case if an exception occurs
-
getRevocationInfoArchival
public static RevocationInfoArchival getRevocationInfoArchival(org.bouncycastle.asn1.ASN1Encodable encodable)ReturnsRevocationInfoArchivalfrom the given encodable- Parameters:
encodable- the encoded data to be parsed- Returns:
- an instance of RevocationValues or null if the parsing failed
-
isPDFDocument
Checks if the givenDSSDocumentrepresents a PDF document- Parameters:
document-DSSDocumentto check- Returns:
- TRUE if the document is a PDF, FALSE otherwise
-