aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/gv/egiz/pdfas/impl/api/sign
diff options
context:
space:
mode:
authornetconomy <netconomy@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2007-11-29 12:00:22 +0000
committernetconomy <netconomy@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2007-11-29 12:00:22 +0000
commit61a2d23ef72630934c603fe9ffb96ebebff6ee09 (patch)
treece05c4470d3a7a2743b4956f512288d6d0d62187 /src/main/java/at/gv/egiz/pdfas/impl/api/sign
parent00809217ec7c890a844f9a7c667c71b550ad92a6 (diff)
downloadpdf-as-3-61a2d23ef72630934c603fe9ffb96ebebff6ee09.tar.gz
pdf-as-3-61a2d23ef72630934c603fe9ffb96ebebff6ee09.tar.bz2
pdf-as-3-61a2d23ef72630934c603fe9ffb96ebebff6ee09.zip
PDF-AS API
git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@233 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c
Diffstat (limited to 'src/main/java/at/gv/egiz/pdfas/impl/api/sign')
-rw-r--r--src/main/java/at/gv/egiz/pdfas/impl/api/sign/ActualSignaturePositionAdapter.java73
-rw-r--r--src/main/java/at/gv/egiz/pdfas/impl/api/sign/SignResultImpl.java75
2 files changed, 148 insertions, 0 deletions
diff --git a/src/main/java/at/gv/egiz/pdfas/impl/api/sign/ActualSignaturePositionAdapter.java b/src/main/java/at/gv/egiz/pdfas/impl/api/sign/ActualSignaturePositionAdapter.java
new file mode 100644
index 0000000..a0c32aa
--- /dev/null
+++ b/src/main/java/at/gv/egiz/pdfas/impl/api/sign/ActualSignaturePositionAdapter.java
@@ -0,0 +1,73 @@
+/**
+ *
+ */
+package at.gv.egiz.pdfas.impl.api.sign;
+
+import at.gv.egiz.pdfas.api.sign.pos.SignaturePosition;
+import at.knowcenter.wag.egov.egiz.pdf.ActualTablePos;
+
+/**
+ * Adapter that converts from a framework ActualTablePos to an API
+ * ActualSignaturePosition.
+ *
+ * @author wprinz
+ *
+ */
+public class ActualSignaturePositionAdapter implements SignaturePosition
+{
+ /**
+ * The framework ActualTablePos.
+ */
+ protected ActualTablePos atp = null;
+
+ /**
+ * Constructor.
+ *
+ * @param actualTablePos
+ * The framework ActualTablePos.
+ */
+ public ActualSignaturePositionAdapter(ActualTablePos actualTablePos)
+ {
+ this.atp = actualTablePos;
+ }
+
+ /**
+ * @see at.gv.egiz.pdfas.api.sign.pos.SignaturePosition#getPage()
+ */
+ public int getPage()
+ {
+ return this.atp.page;
+ }
+
+ /**
+ * @see at.gv.egiz.pdfas.api.sign.pos.SignaturePosition#getX()
+ */
+ public float getX()
+ {
+ return this.atp.x;
+ }
+
+ /**
+ * @see at.gv.egiz.pdfas.api.sign.pos.SignaturePosition#getY()
+ */
+ public float getY()
+ {
+ return this.atp.y;
+ }
+
+ /**
+ * @see at.gv.egiz.pdfas.api.sign.pos.SignaturePosition#getWidth()
+ */
+ public float getWidth()
+ {
+ return this.atp.width;
+ }
+
+ /**
+ * @see at.gv.egiz.pdfas.api.sign.pos.SignaturePosition#getHeight()
+ */
+ public float getHeight()
+ {
+ return this.atp.height;
+ }
+}
diff --git a/src/main/java/at/gv/egiz/pdfas/impl/api/sign/SignResultImpl.java b/src/main/java/at/gv/egiz/pdfas/impl/api/sign/SignResultImpl.java
new file mode 100644
index 0000000..7161f5b
--- /dev/null
+++ b/src/main/java/at/gv/egiz/pdfas/impl/api/sign/SignResultImpl.java
@@ -0,0 +1,75 @@
+/**
+ *
+ */
+package at.gv.egiz.pdfas.impl.api.sign;
+
+import java.security.cert.X509Certificate;
+
+import at.gv.egiz.pdfas.api.io.DataSink;
+import at.gv.egiz.pdfas.api.sign.SignResult;
+import at.gv.egiz.pdfas.api.sign.pos.SignaturePosition;
+
+/**
+ * Implementation of the SignResult interface.
+ *
+ * @author wprinz
+ */
+public class SignResultImpl implements SignResult
+{
+ /**
+ * The filled output DataSink.
+ */
+ protected DataSink outputDocument = null;
+
+ /**
+ * The signer certificate.
+ */
+ protected X509Certificate signerCertificate = null;
+
+ /**
+ * The signature position.
+ */
+ protected SignaturePosition signaturePosition = null;
+
+ /**
+ * Constructor.
+ *
+ * @param outputDocument
+ * The filled output DataSink.
+ * @param signerCertificate
+ * The signer certificate.
+ * @param signaturePosition
+ * The signature position.
+ */
+ public SignResultImpl(DataSink outputDocument, X509Certificate signerCertificate, SignaturePosition signaturePosition)
+ {
+ this.outputDocument = outputDocument;
+ this.signerCertificate = signerCertificate;
+ this.signaturePosition = signaturePosition;
+ }
+
+ /**
+ * @see at.gv.egiz.pdfas.api.sign.SignResult#getOutputDocument()
+ */
+ public DataSink getOutputDocument()
+ {
+ return this.outputDocument;
+ }
+
+ /**
+ * @see at.gv.egiz.pdfas.api.sign.SignResult#getSignaturePosition()
+ */
+ public SignaturePosition getSignaturePosition()
+ {
+ return this.signaturePosition;
+ }
+
+ /**
+ * @see at.gv.egiz.pdfas.api.sign.SignResult#getSignerCertificate()
+ */
+ public X509Certificate getSignerCertificate()
+ {
+ return this.signerCertificate;
+ }
+
+}