diff options
author | Andreas Fitzek <andreas.fitzek@iaik.tugraz.at> | 2014-10-16 12:45:01 +0200 |
---|---|---|
committer | Andreas Fitzek <andreas.fitzek@iaik.tugraz.at> | 2014-10-16 12:45:01 +0200 |
commit | 63784f692a50606f34702706761edac052fdac60 (patch) | |
tree | 50f78a92c35cdfced053209a334944acdee2b983 /pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/util | |
parent | 7b105bafe5a1f4c01224c8ae0b820a478b09447f (diff) | |
download | pdf-as-4-63784f692a50606f34702706761edac052fdac60.tar.gz pdf-as-4-63784f692a50606f34702706761edac052fdac60.tar.bz2 pdf-as-4-63784f692a50606f34702706761edac052fdac60.zip |
Introduced PDF-AS Backends, removed all pdfbox specific code to pdfbox backend
Diffstat (limited to 'pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/util')
-rw-r--r-- | pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/util/SignatureUtils.java | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/util/SignatureUtils.java b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/util/SignatureUtils.java index 3b992e46..cdc7f11e 100644 --- a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/util/SignatureUtils.java +++ b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/util/SignatureUtils.java @@ -9,10 +9,6 @@ import java.io.ByteArrayInputStream; import java.io.IOException; import java.security.SignatureException; -import org.apache.pdfbox.cos.COSArray; -import org.apache.pdfbox.cos.COSDictionary; -import org.apache.pdfbox.cos.COSName; -import org.apache.pdfbox.pdmodel.PDDocument; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -25,49 +21,6 @@ public class SignatureUtils implements ErrorConstants { private static final Logger logger = LoggerFactory .getLogger(SignatureUtils.class); - - public static int countSignatures(PDDocument doc, String sigName) { - int count = 0; - COSDictionary trailer = doc.getDocument().getTrailer(); - COSDictionary root = (COSDictionary) trailer - .getDictionaryObject(COSName.ROOT); - COSDictionary acroForm = (COSDictionary) root - .getDictionaryObject(COSName.ACRO_FORM); - COSArray fields = (COSArray) acroForm - .getDictionaryObject(COSName.FIELDS); - for (int i = 0; i < fields.size(); i++) { - COSDictionary field = (COSDictionary) fields.getObject(i); - String type = field.getNameAsString("FT"); - if ("Sig".equals(type)) { - String name = field.getString(COSName.T); - if (name != null) { - logger.debug("Found Sig: " + name); - try { - if (name.startsWith(sigName)) { - String numberString = name.replace(sigName, ""); - - logger.debug("Found Number: " + numberString); - - int SigIDX = Integer.parseInt(numberString); - if(SigIDX > count) { - count = SigIDX; - } - } - } catch (Throwable e) { - logger.info("Found a different Signature, we do not need to count this."); - } - } - } - - } - - count++; - - logger.debug("Returning sig number: " + count); - - return count; - } - public static VerifyResult verifySignature(byte[] signature, byte[] input) throws PDFASError { //List<VerifyResult> results = new ArrayList<VerifyResult>(); |