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.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ObjectEvaluation.Change
static class
ObjectEvaluation.DocMDP
P number (Optional) The access permissions granted for this document.static class
ObjectEvaluation.FallbackSelectiveComputation
Opção de fallback definida com permissões de acesso igual 2static class
ObjectEvaluation.FieldMDP
static interface
ObjectEvaluation.SelectiveComputation
static class
ObjectEvaluation.Selectiveness
Nested classes/interfaces inherited from class br.ufsc.labsec.signature.conformanceVerifier.pdf.PDDocumentUtils
PDDocumentUtils.OurPDSignature
-
Field Summary
Fields Modifier and Type Field Description protected List<org.apache.pdfbox.cos.COSObjectKey>
objects
Lista de objetos a serem avaliadosprotected int
p
Valor do parâmetro de transformaçãoFields inherited from class br.ufsc.labsec.signature.conformanceVerifier.pdf.PDDocumentUtils
ACTION, ETSI_RFC3161
-
Constructor Summary
Constructors Constructor Description ObjectEvaluation()
-
Method Summary
Modifier and Type Method Description boolean
allValidEntries(org.apache.pdfbox.cos.COSBase base, Set<org.apache.pdfbox.cos.COSName> validEntries)
protected void
appendIdentifier(org.apache.pdfbox.cos.COSBase base, OutputStream outputStream)
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)
protected boolean
compute(org.apache.pdfbox.cos.COSBase a, OutputStream outputStream, Set<org.apache.pdfbox.cos.COSObjectKey> visited, ObjectEvaluation.SelectiveComputation selectiveComputation)
Escreve em um outputStream os dados de uma estrutura interna do PDF.boolean
computeAction(org.apache.pdfbox.cos.COSBase base, OutputStream outputStream, Set<org.apache.pdfbox.cos.COSObjectKey> visited, ObjectEvaluation.SelectiveComputation selectiveComputation)
boolean
computeAdditionalActions(org.apache.pdfbox.cos.COSBase base, OutputStream outputStream, Set<org.apache.pdfbox.cos.COSObjectKey> visited, ObjectEvaluation.SelectiveComputation selectiveComputation)
protected boolean
computeAnnotation(org.apache.pdfbox.cos.COSBase base, OutputStream outputStream, Set<org.apache.pdfbox.cos.COSObjectKey> visited, ObjectEvaluation.SelectiveComputation selectiveComputation)
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)
protected void
computeArray(org.apache.pdfbox.cos.COSArray array, OutputStream outputStream, Set<org.apache.pdfbox.cos.COSObjectKey> visited, ObjectEvaluation.SelectiveComputation selectiveComputation)
protected void
computeBoolean(org.apache.pdfbox.cos.COSBoolean cosboolean, OutputStream outputStream)
protected void
computeDictionary(org.apache.pdfbox.cos.COSDictionary cosDictionary, OutputStream outputStream, Set<org.apache.pdfbox.cos.COSObjectKey> visited, ObjectEvaluation.SelectiveComputation selectiveComputation)
protected byte[]
computeDocument(org.apache.pdfbox.pdmodel.PDDocument document, Set<org.apache.pdfbox.cos.COSObjectKey> previousExistingFields, ObjectEvaluation.SelectiveComputation selectiveComputation)
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)
byte[]
computeFields(org.apache.pdfbox.pdmodel.PDDocument document, ObjectEvaluation.FieldMDP fieldMDP)
protected void
computeFloat(org.apache.pdfbox.cos.COSFloat cosfloat, OutputStream outputStream)
boolean
computeFormField(org.apache.pdfbox.cos.COSBase base, OutputStream outputStream, Set<org.apache.pdfbox.cos.COSObjectKey> visited, ObjectEvaluation.SelectiveComputation selectiveComputation)
protected void
computeInteger(org.apache.pdfbox.cos.COSInteger cosinteger, OutputStream outputStream)
protected void
computeName(org.apache.pdfbox.cos.COSName cosname, OutputStream outputStream)
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)
protected void
computeNull(org.apache.pdfbox.cos.COSNull cosnull, OutputStream outputStream)
protected void
computeObject(org.apache.pdfbox.cos.COSObject object, OutputStream outputStream, Set<org.apache.pdfbox.cos.COSObjectKey> visited, ObjectEvaluation.SelectiveComputation selectiveComputation)
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)
protected boolean
computeStream(org.apache.pdfbox.cos.COSBase base, OutputStream outputStream, Set<org.apache.pdfbox.cos.COSObjectKey> visited, ObjectEvaluation.SelectiveComputation selectiveComputation)
protected void
computeString(org.apache.pdfbox.cos.COSString cosstring, OutputStream outputStream)
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 arrayprotected 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)
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)
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)
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)
boolean
isAAAnnotationValid(org.apache.pdfbox.cos.COSBase base)
boolean
isAACatalogValid(org.apache.pdfbox.cos.COSBase base)
boolean
isAAFormFieldValid(org.apache.pdfbox.cos.COSBase base)
boolean
isAAPageValid(org.apache.pdfbox.cos.COSBase base)
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 objetosprotected 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)
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)
protected void
tryComputeObjectOr(org.apache.pdfbox.cos.COSBase base, OutputStream outputStream, Set<org.apache.pdfbox.cos.COSObjectKey> visited, Callable<?> runnable)
protected void
write4bytesInteger(int integer, OutputStream outputStream)
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)
protected void
writeName(org.apache.pdfbox.cos.COSName cosname, OutputStream outputStream)
Methods inherited from class br.ufsc.labsec.signature.conformanceVerifier.pdf.PDDocumentUtils
as, asCOSObject, asOptional, closePDDocument, compare, comparePosition, containsTransformMethod, copyVisualSignature, digest, digest, DIGEST, DIGEST, DIGEST, equalLock, fieldTypeFromHierarchy, formatXpath, GET_SIGNED_DOCUMENT, getAcroForm, getAnnotations, getApprovalSignatures, getBaseAcroForm, getBaseIdentification, getByteRangeForRemovingLastSignature, getCatalog, getCertificationSignature, getDocMDP, getDocTimestampsOfSignature, getDocTimestampsOfSignature, getEmbeddedFiles, getEmbeddedFiles, getEntry, getFieldMDP, getFieldMDP, getFieldsFromHierarchy, getFieldsFromHierarchy, getFieldsFromHierarchy, getFieldsFromHierarchy, getFirstSignature, getFirstSignatureByteRange, getFullyQualifiedName, getLastSignature, getNamedObjects, getNamedObjects, getNamedPages, getNamesDictionary, getObjectIdentification, getPageObjects, getPagesFromDocument, getReference, getReference, getReferenceFromSignature, getReferences, getReferences, getReferencesAsList, getReferencesAsList, getRootFields, getRootFieldsFromDocument, getSignatures, getSignedDocument, getValuesFromNameTree, getWidgetParent, hasDocMDP, hasEntry, hasFieldMDP, hasFieldMDP, isAcroForm, isAnnotation, isCatalog, isField, isFieldEntry, isNonTerminalField, isPage, isPageNode, isPageObject, isSignatureDictionary, isSignatureField, isSignatureWidget, isSignedSignatureField, isTerminalField, isTimestampField, isTimestampWidget, isUnsignedSignatureField, isWidget, openPDDocument, openPDDocument, openPDDocument, retrieveAddress, signs, signs, signs, signs, signs, toCOSObjectKey
-
Field Details
-
objects
Lista de objetos a serem avaliados -
p
protected int pValor 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 IOExceptionEscreve em um outputStream os dados de uma estrutura interna do PDF.- Parameters:
a
- Estrutura de PDF contendo conteúdooutputStream
- Escrita do conteúdo de estrutura PDFvisited
- Mapa de objetos visitados para evitar recursãoselectiveComputation
- 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
- Throws:
IOException
-
compare
-
parseArray
-
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 objetosbase
- 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 comparadobase2
- Outro objeto a ser comparado- Returns:
- Indica se os objetos são iguais
-