pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jahew...@apache.org
Subject svn commit: r1577296 - in /pdfbox/trunk: examples/src/main/java/org/apache/pdfbox/examples/signature/ pdfbox/src/main/java/org/apache/pdfbox/pdmodel/ pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/
Date Thu, 13 Mar 2014 19:40:42 GMT
Author: jahewson
Date: Thu Mar 13 19:40:41 2014
New Revision: 1577296

URL: http://svn.apache.org/r1577296
Log:
PDFBOX-1847: clean up qualified PDSignature names

Modified:
    pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/CreateSignature.java
    pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/CreateVisibleSignature.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDSignatureField.java

Modified: pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/CreateSignature.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/CreateSignature.java?rev=1577296&r1=1577295&r2=1577296&view=diff
==============================================================================
--- pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/CreateSignature.java
(original)
+++ pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/CreateSignature.java
Thu Mar 13 19:40:41 2014
@@ -177,6 +177,7 @@ public class CreateSignature implements 
      *
      * Use your favorite cryptographic library to implement pkcs7 signature creation.
      */
+    @Override
     public byte[] sign(InputStream content) throws IOException
     {
         CMSProcessableInputStream input = new CMSProcessableInputStream(content);
@@ -187,10 +188,8 @@ public class CreateSignature implements 
         CertStore certStore = null;
         try
         {
-            certStore = CertStore.getInstance("Collection",
-                    new CollectionCertStoreParameters(certList), provider);
-            gen.addSigner(privKey, (X509Certificate) certList.get(0),
-                    CMSSignedGenerator.DIGEST_SHA256);
+            certStore = CertStore.getInstance("Collection", new CollectionCertStoreParameters(certList),
provider);
+            gen.addSigner(privKey, (X509Certificate) certList.get(0), CMSSignedGenerator.DIGEST_SHA256);
             gen.addCertificatesAndCRLs(certStore);
             CMSSignedData signedData = gen.generate(input, false, provider);
             return signedData.getEncoded();

Modified: pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/CreateVisibleSignature.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/CreateVisibleSignature.java?rev=1577296&r1=1577295&r2=1577296&view=diff
==============================================================================
--- pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/CreateVisibleSignature.java
(original)
+++ pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/CreateVisibleSignature.java
Thu Mar 13 19:40:41 2014
@@ -178,7 +178,7 @@ public class CreateVisibleSignature impl
      * This method will be called from inside of the pdfbox and create the pkcs7 signature.
      * The given InputStream contains the bytes that are given by the byte range.
      *
-     * This method is for internal use only.  <-- TODO this method should be private
+     * This method is for internal use only. <-- TODO this method should be private
      *
      * Use your favorite cryptographic library to implement pkcs7 signature creation.
      */

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java?rev=1577296&r1=1577295&r2=1577296&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java Thu Mar 13
19:40:41 2014
@@ -60,6 +60,7 @@ import org.apache.pdfbox.pdmodel.encrypt
 import org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation;
 import org.apache.pdfbox.pdmodel.interactive.annotation.PDAppearanceDictionary;
 import org.apache.pdfbox.pdmodel.interactive.annotation.PDAppearanceStream;
+import org.apache.pdfbox.pdmodel.interactive.digitalsignature.PDSignature;
 import org.apache.pdfbox.pdmodel.interactive.digitalsignature.SignatureInterface;
 import org.apache.pdfbox.pdmodel.interactive.digitalsignature.SignatureOptions;
 import org.apache.pdfbox.pdmodel.interactive.form.PDAcroForm;
@@ -263,7 +264,7 @@ public class PDDocument implements Close
      * @param signatureInterface is a interface which provides signing capabilities
      * @throws IOException if there is an error creating required fields
      */
-    public void addSignature(org.apache.pdfbox.pdmodel.interactive.digitalsignature.PDSignature
sigObject, SignatureInterface signatureInterface) throws IOException
+    public void addSignature(PDSignature sigObject, SignatureInterface signatureInterface)
throws IOException
     {
         SignatureOptions defaultOptions = new SignatureOptions();
         defaultOptions.setPage(1);
@@ -278,7 +279,7 @@ public class PDDocument implements Close
      * @param options signature options
      * @throws IOException if there is an error creating required fields
      */
-    public void addSignature(org.apache.pdfbox.pdmodel.interactive.digitalsignature.PDSignature
sigObject, SignatureInterface signatureInterface, SignatureOptions options)
+    public void addSignature(PDSignature sigObject, SignatureInterface signatureInterface,
SignatureOptions options)
             throws IOException
     {
         // Reserve content
@@ -364,7 +365,7 @@ public class PDDocument implements Close
         {
             if (pdField instanceof PDSignatureField)
             {
-                org.apache.pdfbox.pdmodel.interactive.digitalsignature.PDSignature signature
= ((PDSignatureField) pdField).getSignature();
+                PDSignature signature = ((PDSignatureField) pdField).getSignature();
                 if (signature != null && signature.getDictionary().equals(sigObject.getDictionary()))
                 {
                     signatureField = (PDSignatureField) pdField;
@@ -539,7 +540,7 @@ public class PDDocument implements Close
 
         for (PDSignatureField sigField : sigFields)
         {
-            org.apache.pdfbox.pdmodel.interactive.digitalsignature.PDSignature sigObject
= sigField.getSignature();
+            PDSignature sigObject = sigField.getSignature();
             sigField.getCOSObject().setNeedToBeUpdate(true);
 
             // Check if the field already exist
@@ -799,9 +800,9 @@ public class PDDocument implements Close
      * @return the last signature as <code>PDSignatureField</code>.
      * @throws IOException if no document catalog can be found.
      */
-    public org.apache.pdfbox.pdmodel.interactive.digitalsignature.PDSignature getLastSignatureDictionary()
throws IOException
+    public PDSignature getLastSignatureDictionary() throws IOException
     {
-        List<org.apache.pdfbox.pdmodel.interactive.digitalsignature.PDSignature> signatureDictionaries
= getSignatureDictionaries();
+        List<PDSignature> signatureDictionaries = getSignatureDictionaries();
         int size = signatureDictionaries.size();
         if (size > 0)
         {
@@ -837,13 +838,13 @@ public class PDDocument implements Close
      * @return a <code>List</code> of <code>PDSignatureField</code>s
      * @throws IOException if no document catalog can be found.
      */
-    public List<org.apache.pdfbox.pdmodel.interactive.digitalsignature.PDSignature>
getSignatureDictionaries() throws IOException
+    public List<PDSignature> getSignatureDictionaries() throws IOException
     {
         List<COSDictionary> signatureDictionary = document.getSignatureDictionaries();
-        List<org.apache.pdfbox.pdmodel.interactive.digitalsignature.PDSignature> signatures
= new LinkedList<org.apache.pdfbox.pdmodel.interactive.digitalsignature.PDSignature>();
+        List<PDSignature> signatures = new LinkedList<PDSignature>();
         for (COSDictionary dict : signatureDictionary)
         {
-            signatures.add(new org.apache.pdfbox.pdmodel.interactive.digitalsignature.PDSignature(dict));
+            signatures.add(new PDSignature(dict));
         }
         return signatures;
     }

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDSignatureField.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDSignatureField.java?rev=1577296&r1=1577295&r2=1577296&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDSignatureField.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDSignatureField.java
Thu Mar 13 19:40:41 2014
@@ -21,6 +21,7 @@ import org.apache.pdfbox.cos.COSDictiona
 import org.apache.pdfbox.cos.COSName;
 import org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotationWidget;
 import org.apache.pdfbox.pdmodel.interactive.digitalsignature.PDSeedValue;
+import org.apache.pdfbox.pdmodel.interactive.digitalsignature.PDSignature;
 
 import java.io.IOException;
 import java.util.HashSet;
@@ -144,7 +145,7 @@ public class PDSignatureField extends PD
      * 
      * @param value is the PDSignatureField
      */
-    public void setSignature(org.apache.pdfbox.pdmodel.interactive.digitalsignature.PDSignature
value)
+    public void setSignature(PDSignature value)
     {
       getDictionary().setItem(COSName.V, value);
     }
@@ -155,14 +156,14 @@ public class PDSignatureField extends PD
      * @return the signature dictionary
      * 
      */
-    public org.apache.pdfbox.pdmodel.interactive.digitalsignature.PDSignature getSignature()
+    public PDSignature getSignature()
     {
       COSBase dictionary = getDictionary().getDictionaryObject(COSName.V);
       if (dictionary == null)
       {
           return null;
       }
-      return new org.apache.pdfbox.pdmodel.interactive.digitalsignature.PDSignature((COSDictionary)dictionary);
+      return new PDSignature((COSDictionary)dictionary);
     }
 
     /**



Mime
View raw message