diff options
author | tknall <tknall@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c> | 2009-12-14 13:47:48 +0000 |
---|---|---|
committer | tknall <tknall@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c> | 2009-12-14 13:47:48 +0000 |
commit | 9b615852df5f56eeb67c4dd021a56e72d31a2498 (patch) | |
tree | 5cdf42cdb8dd552d73f7d4ef4299aa4743975d5e /src/main/java/demo | |
parent | 8ba10b6fa16c78ec3a8661d7b050320971495405 (diff) | |
download | pdf-as-3-9b615852df5f56eeb67c4dd021a56e72d31a2498.tar.gz pdf-as-3-9b615852df5f56eeb67c4dd021a56e72d31a2498.tar.bz2 pdf-as-3-9b615852df5f56eeb67c4dd021a56e72d31a2498.zip |
Error code created for protected pdf documents.
SettingsReader: Debug message for getInternalResource added (TRACE)
multipart/formdata: align multipart charset with data charset
added FIXME notes for FileHelper.readFromFile
Signature/Verification-Demo updated
git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@507 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c
Diffstat (limited to 'src/main/java/demo')
-rw-r--r-- | src/main/java/demo/SignatureCreationDemo.java | 15 | ||||
-rw-r--r-- | src/main/java/demo/SignatureVerificationDemo.java | 15 |
2 files changed, 25 insertions, 5 deletions
diff --git a/src/main/java/demo/SignatureCreationDemo.java b/src/main/java/demo/SignatureCreationDemo.java index c43b45e..465a0bf 100644 --- a/src/main/java/demo/SignatureCreationDemo.java +++ b/src/main/java/demo/SignatureCreationDemo.java @@ -12,6 +12,7 @@ import at.gv.egiz.pdfas.api.exceptions.PdfAsException; import at.gv.egiz.pdfas.api.io.DataSource;
import at.gv.egiz.pdfas.api.sign.SignParameters;
import at.gv.egiz.pdfas.api.sign.SignResult;
+import at.gv.egiz.pdfas.api.timestamp.DummyTimeStamper;
import at.gv.egiz.pdfas.io.FileBasedDataSink;
import at.gv.egiz.pdfas.io.FileBasedDataSource;
@@ -55,10 +56,20 @@ public class SignatureCreationDemo { SignParameters signParameters = new SignParameters();
signParameters.setDocument(dataSource);
signParameters.setOutput(dataSink);
- signParameters.setSignatureType(Constants.SIGNATURE_TYPE_BINARY);
signParameters.setSignatureDevice(Constants.SIGNATURE_DEVICE_MOA);
- signParameters.setSignatureProfileId("SIGNATURBLOCK_DE");
signParameters.setSignaturePositioning(null);
+ // standard signature
+ signParameters.setSignatureType(Constants.SIGNATURE_TYPE_TEXTUAL);
+ signParameters.setSignatureProfileId("SIGNATURBLOCK_DE");
+
+ // --- enable in case of BAIK SIGNATURE ---
+ /*
+ signParameters.setSignatureType(Constants.SIGNATURE_TYPE_BINARY);
+ // signParameters.setSignatureProfileId("BAIK_URKUNDE_SIGNATUR");
+ signParameters.setSignatureProfileId("BAIK_ARCHIV_SIGNATUR");
+ // use BAIK TimeStamp
+ signParameters.setTimeStamperImpl(new DummyTimeStamper());
+ */
// sign
System.out.println("Signing...");
diff --git a/src/main/java/demo/SignatureVerificationDemo.java b/src/main/java/demo/SignatureVerificationDemo.java index 6df4973..86d1bb8 100644 --- a/src/main/java/demo/SignatureVerificationDemo.java +++ b/src/main/java/demo/SignatureVerificationDemo.java @@ -90,15 +90,24 @@ public class SignatureVerificationDemo { while (it.hasNext()) {
VerifyResult result = (VerifyResult) it.next();
Main.formatVerifyResult(result, out);
+
+ // check if there are timestamps
+ if (result.getTimeStampValue() != null) {
+ out.println("\nTimeStamp value available for this signature");
+ }
+
+ // check if non textual elements have been detected for this signature
if (result.hasNonTextualObjects()) {
- System.out.println("\nWARNING: Non textual objects detected.");
+ out.println("\nWARNING: Non textual objects detected for this signature");
Iterator noit = result.getNonTextualObjects().iterator();
while (noit.hasNext()) {
NonTextObjectInfo info = (NonTextObjectInfo) noit.next();
- System.out.println(" -> " + info.toString());
+ out.println(" -> " + info.toString());
}
- System.out.println();
+ out.println();
+ } else {
+ out.println("\nNo non-textual objects detected for this signature.");
}
}
out.flush();
|