Class ObjectEvaluation

java.lang.Object
br.ufsc.labsec.signature.conformanceVerifier.pdf.PDDocumentUtils
br.ufsc.labsec.signature.conformanceVerifier.pdf.ObjectEvaluation

public class ObjectEvaluation
extends PDDocumentUtils
Esta classe engloba métodos para a avaliação de objetos em uma assinatura PDF.
  • Field Details

    • objects

      protected List<org.apache.pdfbox.cos.COSObjectKey> objects
      Lista de objetos a serem avaliados
    • p

      protected int p
      Valor do parâmetro de transformação
  • Constructor Details

    • ObjectEvaluation

      public ObjectEvaluation()
  • Method Details

    • parseDictionary

      protected List<Action> parseDictionary​(org.apache.pdfbox.cos.COSDictionary dictionary1, org.apache.pdfbox.cos.COSDictionary dictionary2, br.ufsc.labsec.signature.conformanceVerifier.pdf.Action.Path path, org.apache.pdfbox.cos.COSObjectKey origin, Map<org.apache.pdfbox.cos.COSObjectKey,​List<Action>> visited)
    • computeDocument

      protected byte[] computeDocument​(org.apache.pdfbox.pdmodel.PDDocument document, Set<org.apache.pdfbox.cos.COSObjectKey> previousExistingFields, ObjectEvaluation.SelectiveComputation selectiveComputation) throws IOException
      Throws:
      IOException
    • ifPresent

      protected void ifPresent​(org.apache.pdfbox.cos.COSDictionary dictionary, org.apache.pdfbox.cos.COSName entry, OutputStream outputStream, Set<org.apache.pdfbox.cos.COSObjectKey> visited, ObjectEvaluation.SelectiveComputation selectiveComputation) throws IOException
      Throws:
      IOException
    • ifPresent

      protected void ifPresent​(org.apache.pdfbox.cos.COSDictionary dictionary, org.apache.pdfbox.cos.COSName entry, OutputStream outputStream, Set<org.apache.pdfbox.cos.COSObjectKey> visited, ObjectEvaluation.SelectiveComputation selectiveComputation, boolean inheritable) throws IOException
      Throws:
      IOException
    • ifPresent

      protected void ifPresent​(org.apache.pdfbox.cos.COSDictionary dictionary, org.apache.pdfbox.cos.COSName entry, OutputStream outputStream, Set<org.apache.pdfbox.cos.COSObjectKey> visited, ObjectEvaluation.SelectiveComputation selectiveComputation, boolean inheritable, Callable<?> callable) throws IOException
      Throws:
      IOException
    • computePageObject

      protected boolean computePageObject​(org.apache.pdfbox.cos.COSBase base, OutputStream outputStream, Set<org.apache.pdfbox.cos.COSObjectKey> visited, Set<org.apache.pdfbox.cos.COSObjectKey> previousExistingFields, ObjectEvaluation.SelectiveComputation selectiveComputation, org.apache.pdfbox.pdmodel.PDDocument document) throws IOException
      Throws:
      IOException
    • computeNamedPage

      protected boolean computeNamedPage​(org.apache.pdfbox.cos.COSBase base, OutputStream outputStream, Set<org.apache.pdfbox.cos.COSObjectKey> visited, Set<org.apache.pdfbox.cos.COSObjectKey> previousExistingFields, ObjectEvaluation.SelectiveComputation selectiveComputation, org.apache.pdfbox.pdmodel.PDDocument document) throws IOException
      Throws:
      IOException
    • computeEmbeddedFiles

      protected boolean computeEmbeddedFiles​(org.apache.pdfbox.cos.COSString filename, org.apache.pdfbox.cos.COSBase base, OutputStream outputStream, Set<org.apache.pdfbox.cos.COSObjectKey> visited, ObjectEvaluation.SelectiveComputation selectiveComputation) throws IOException
      Throws:
      IOException
    • computeAnnotations

      protected boolean computeAnnotations​(org.apache.pdfbox.cos.COSBase base, OutputStream outputStream, Set<org.apache.pdfbox.cos.COSObjectKey> visited, Set<org.apache.pdfbox.cos.COSObjectKey> existingSignatureFields, ObjectEvaluation.SelectiveComputation selectiveComputation, org.apache.pdfbox.pdmodel.PDDocument document) throws IOException
      Throws:
      IOException
    • computeAnnotation

      protected boolean computeAnnotation​(org.apache.pdfbox.cos.COSBase base, OutputStream outputStream, Set<org.apache.pdfbox.cos.COSObjectKey> visited, ObjectEvaluation.SelectiveComputation selectiveComputation) throws IOException
      Throws:
      IOException
    • computeFormField

      public boolean computeFormField​(org.apache.pdfbox.cos.COSBase base, OutputStream outputStream, Set<org.apache.pdfbox.cos.COSObjectKey> visited, ObjectEvaluation.SelectiveComputation selectiveComputation) throws IOException
      Throws:
      IOException
    • computeAction

      public boolean computeAction​(org.apache.pdfbox.cos.COSBase base, OutputStream outputStream, Set<org.apache.pdfbox.cos.COSObjectKey> visited, ObjectEvaluation.SelectiveComputation selectiveComputation) throws IOException
      Throws:
      IOException
    • computeAdditionalActions

      public boolean computeAdditionalActions​(org.apache.pdfbox.cos.COSBase base, OutputStream outputStream, Set<org.apache.pdfbox.cos.COSObjectKey> visited, ObjectEvaluation.SelectiveComputation selectiveComputation) throws IOException
      Throws:
      IOException
    • isAACatalogValid

      public boolean isAACatalogValid​(org.apache.pdfbox.cos.COSBase base)
    • isAAPageValid

      public boolean isAAPageValid​(org.apache.pdfbox.cos.COSBase base)
    • isAAAnnotationValid

      public boolean isAAAnnotationValid​(org.apache.pdfbox.cos.COSBase base)
    • isAAFormFieldValid

      public boolean isAAFormFieldValid​(org.apache.pdfbox.cos.COSBase base)
    • allValidEntries

      public boolean allValidEntries​(org.apache.pdfbox.cos.COSBase base, Set<org.apache.pdfbox.cos.COSName> validEntries)
    • computeFields

      public byte[] computeFields​(org.apache.pdfbox.pdmodel.PDDocument document, ObjectEvaluation.FieldMDP fieldMDP) throws IOException
      Throws:
      IOException
    • compute

      protected boolean compute​(org.apache.pdfbox.cos.COSBase a, OutputStream outputStream, Set<org.apache.pdfbox.cos.COSObjectKey> visited, ObjectEvaluation.SelectiveComputation selectiveComputation) throws IOException
      Escreve em um outputStream os dados de uma estrutura interna do PDF.
      Parameters:
      a - Estrutura de PDF contendo conteúdo
      outputStream - Escrita do conteúdo de estrutura PDF
      visited - Mapa de objetos visitados para evitar recursão
      selectiveComputation - Parâmetros de verificação para computações seletivas.
      Throws:
      IOException
    • appendIdentifier

      protected void appendIdentifier​(org.apache.pdfbox.cos.COSBase base, OutputStream outputStream) throws IOException
      Throws:
      IOException
    • tryComputeObjectOr

      protected void tryComputeObjectOr​(org.apache.pdfbox.cos.COSBase base, OutputStream outputStream, Set<org.apache.pdfbox.cos.COSObjectKey> visited, Callable<?> runnable) throws IOException
      Throws:
      IOException
    • computeObject

      protected void computeObject​(org.apache.pdfbox.cos.COSObject object, OutputStream outputStream, Set<org.apache.pdfbox.cos.COSObjectKey> visited, ObjectEvaluation.SelectiveComputation selectiveComputation) throws IOException
      Throws:
      IOException
    • computeNull

      protected void computeNull​(org.apache.pdfbox.cos.COSNull cosnull, OutputStream outputStream) throws IOException
      Throws:
      IOException
    • computeInteger

      protected void computeInteger​(org.apache.pdfbox.cos.COSInteger cosinteger, OutputStream outputStream) throws IOException
      Throws:
      IOException
    • computeFloat

      protected void computeFloat​(org.apache.pdfbox.cos.COSFloat cosfloat, OutputStream outputStream) throws IOException
      Throws:
      IOException
    • computeBoolean

      protected void computeBoolean​(org.apache.pdfbox.cos.COSBoolean cosboolean, OutputStream outputStream) throws IOException
      Throws:
      IOException
    • computeName

      protected void computeName​(org.apache.pdfbox.cos.COSName cosname, OutputStream outputStream) throws IOException
      Throws:
      IOException
    • computeString

      protected void computeString​(org.apache.pdfbox.cos.COSString cosstring, OutputStream outputStream) throws IOException
      Throws:
      IOException
    • computeDictionary

      protected void computeDictionary​(org.apache.pdfbox.cos.COSDictionary cosDictionary, OutputStream outputStream, Set<org.apache.pdfbox.cos.COSObjectKey> visited, ObjectEvaluation.SelectiveComputation selectiveComputation) throws IOException
      Throws:
      IOException
    • computeArray

      protected void computeArray​(org.apache.pdfbox.cos.COSArray array, OutputStream outputStream, Set<org.apache.pdfbox.cos.COSObjectKey> visited, ObjectEvaluation.SelectiveComputation selectiveComputation) throws IOException
      Throws:
      IOException
    • computeStream

      protected boolean computeStream​(org.apache.pdfbox.cos.COSBase base, OutputStream outputStream, Set<org.apache.pdfbox.cos.COSObjectKey> visited, ObjectEvaluation.SelectiveComputation selectiveComputation) throws IOException
      Throws:
      IOException
    • ifPresentKeyValuePair

      protected void ifPresentKeyValuePair​(org.apache.pdfbox.cos.COSDictionary dictionary, org.apache.pdfbox.cos.COSName key, OutputStream outputStream, Set<org.apache.pdfbox.cos.COSObjectKey> visited, ObjectEvaluation.SelectiveComputation selectiveComputation) throws IOException
      Throws:
      IOException
    • writeKeyValuePair

      protected void writeKeyValuePair​(org.apache.pdfbox.cos.COSName key, org.apache.pdfbox.cos.COSBase value, OutputStream outputStream, Set<org.apache.pdfbox.cos.COSObjectKey> visited, ObjectEvaluation.SelectiveComputation selectiveComputation) throws IOException
      Throws:
      IOException
    • writeName

      protected void writeName​(org.apache.pdfbox.cos.COSName cosname, OutputStream outputStream) throws IOException
      Throws:
      IOException
    • write4bytesInteger

      protected void write4bytesInteger​(int integer, OutputStream outputStream) throws IOException
      Throws:
      IOException
    • compare

      protected List<Action> compare​(org.apache.pdfbox.cos.COSBase a, org.apache.pdfbox.cos.COSBase b, br.ufsc.labsec.signature.conformanceVerifier.pdf.Action.Path path, org.apache.pdfbox.cos.COSObjectKey origin, Map<org.apache.pdfbox.cos.COSObjectKey,​List<Action>> visited)
    • parseArray

      protected List<Action> parseArray​(org.apache.pdfbox.cos.COSArray array1, org.apache.pdfbox.cos.COSArray array2, br.ufsc.labsec.signature.conformanceVerifier.pdf.Action.Path path, org.apache.pdfbox.cos.COSObjectKey origin, Map<org.apache.pdfbox.cos.COSObjectKey,​List<Action>> visited)
    • findInCOSArray

      protected int findInCOSArray​(org.apache.pdfbox.cos.COSArray array, org.apache.pdfbox.cos.COSBase base, br.ufsc.labsec.signature.conformanceVerifier.pdf.Action.Path path, Map<org.apache.pdfbox.cos.COSObjectKey,​List<Action>> visited)
      Busca a posição do elemento no array
      Parameters:
      array - O array de objetos
      base - O objeto base
      Returns:
      O índice do objeto no array
    • isEqual

      protected boolean isEqual​(org.apache.pdfbox.cos.COSBase base1, org.apache.pdfbox.cos.COSBase base2, br.ufsc.labsec.signature.conformanceVerifier.pdf.Action.Path path, Map<org.apache.pdfbox.cos.COSObjectKey,​List<Action>> visited)
      Método de comparação entre dois objetos
      Parameters:
      base1 - Um objeto a ser comparado
      base2 - Outro objeto a ser comparado
      Returns:
      Indica se os objetos são iguais