Class PAdESUtils

java.lang.Object
eu.europa.esig.dss.pades.PAdESUtils

public final class PAdESUtils
extends Object
Utils for dealing with PAdES
  • Field Details

    • DEFAULT_FIRST_PAGE

      public static final int DEFAULT_FIRST_PAGE
      Defines a number of a first page in a document
      See Also:
      Constant Field Values
  • Method Details

    • getOriginalPDF

      public static InMemoryDocument getOriginalPDF​(PAdESSignature padesSignature)
      Returns the original signed content for the padesSignature
      Parameters:
      padesSignature - PAdESSignature
      Returns:
      InMemoryDocument
    • getOriginalPDF

      public static InMemoryDocument getOriginalPDF​(PdfCMSRevision pdfRevision)
      Returns the original signed content for the pdfRevision
      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 - DSSDocument the original document
      byteRange - ByteRange representing the signed revision, to get the previous covered PDF for
      Returns:
      InMemoryDocument the PDF document up to the signed revision
    • getSignedContent

      public static byte[] getSignedContent​(DSSDocument dssDocument, ByteRange byteRange) throws IOException
      Returns a signed content according to the provided byteRange
      Parameters:
      dssDocument - DSSDocument to extract the content from
      byteRange - ByteRange indicating 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)
      Returns RevocationInfoArchival from the given encodable
      Parameters:
      encodable - the encoded data to be parsed
      Returns:
      an instance of RevocationValues or null if the parsing failed
    • isPDFDocument

      public static boolean isPDFDocument​(DSSDocument document)
      Checks if the given DSSDocument represents a PDF document
      Parameters:
      document - DSSDocument to check
      Returns:
      TRUE if the document is a PDF, FALSE otherwise