summaryrefslogtreecommitdiff
path: root/pdf-over-signer
diff options
context:
space:
mode:
authortkellner <tkellner@174cde9d-5d70-4d2a-aa98-46368bc2aaf7>2013-04-10 18:51:43 +0000
committertkellner <tkellner@174cde9d-5d70-4d2a-aa98-46368bc2aaf7>2013-04-10 18:51:43 +0000
commitf34d3f0dc4bd88a8a54f5707a4f4fa3b845637a5 (patch)
tree76b1ae5ef706a3e06e9e2631867334a961ab4c37 /pdf-over-signer
parent782e41eee1f04f86bc895a95cd2d51353284987a (diff)
downloadmocca-f34d3f0dc4bd88a8a54f5707a4f4fa3b845637a5.tar.gz
mocca-f34d3f0dc4bd88a8a54f5707a4f4fa3b845637a5.tar.bz2
mocca-f34d3f0dc4bd88a8a54f5707a4f4fa3b845637a5.zip
Added class templates
Old class files edited to match templates Fixed missing comments git-svn-id: https://joinup.ec.europa.eu/svn/pdf-over/trunk@12 174cde9d-5d70-4d2a-aa98-46368bc2aaf7
Diffstat (limited to 'pdf-over-signer')
-rw-r--r--pdf-over-signer/pdf-over-sigpdfas/.settings/org.eclipse.jdt.ui.prefs3
-rw-r--r--pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/ByteArrayPDFASDataSource.java34
-rw-r--r--pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASHelper.java24
-rw-r--r--pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASSLRequest.java33
-rw-r--r--pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASSignerFactory.java26
-rw-r--r--pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASSigningState.java63
-rw-r--r--pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PdfAsSignatureParameter.java34
7 files changed, 211 insertions, 6 deletions
diff --git a/pdf-over-signer/pdf-over-sigpdfas/.settings/org.eclipse.jdt.ui.prefs b/pdf-over-signer/pdf-over-sigpdfas/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 00000000..4a2bd43a
--- /dev/null
+++ b/pdf-over-signer/pdf-over-sigpdfas/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,3 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.ui.javadoc=true
+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * @return the ${bare_field_name}\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * @param ${param} the ${bare_field_name} to set\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * ${tags}\n */</template><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/*\n * Copyright 2012 by A-SIT, Secure Information Technology Center Austria\n *\n * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by\n * the European Commission - subsequent versions of the EUPL (the "Licence");\n * You may not use this work except in compliance with the Licence.\n * You may obtain a copy of the Licence at\:\n * http\://joinup.ec.europa.eu/software/page/eupl\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the Licence is distributed on an "AS IS" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the Licence for the specific language governing permissions and\n * limitations under the Licence.\n */</template><template autoinsert\="false" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\n * \n *\n * ${tags}\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\n * \n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * ${tags}\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Javadoc)\n * ${see_to_overridden}\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\n * ${tags}\n * ${see_to_target}\n */</template><template autoinsert\="false" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\n${package_declaration}\n\n// Imports\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\n\n${typecomment}\n${type_declaration}</template><template autoinsert\="false" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\n/**\n * SFL4J Logger instance\n**/\nprivate static final Logger log \= LoggerFactory.getLogger(${type_name}.class);\n\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method stub\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates>
diff --git a/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/ByteArrayPDFASDataSource.java b/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/ByteArrayPDFASDataSource.java
index 0fa23192..31e522db 100644
--- a/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/ByteArrayPDFASDataSource.java
+++ b/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/ByteArrayPDFASDataSource.java
@@ -1,14 +1,48 @@
+/*
+ * Copyright 2012 by A-SIT, Secure Information Technology Center Austria
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://joinup.ec.europa.eu/software/page/eupl
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ */
package at.asit.pdfover.signer.pdfas;
+//Imports
import java.io.ByteArrayInputStream;
import java.io.InputStream;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import at.gv.egiz.pdfas.api.io.DataSource;
+/**
+ * PDF - AS Specific Data Source with byte array representation
+ */
public class ByteArrayPDFASDataSource implements DataSource {
+ /**
+ * SFL4J Logger instance
+ **/
+ private static final Logger log = LoggerFactory.getLogger(ByteArrayPDFASDataSource.class);
+
+ /**
+ * Internal data byte array
+ */
private byte[] data;
+ /**
+ * Default constructor
+ * @param data The byte[] to be used
+ */
public ByteArrayPDFASDataSource(byte[] data) {
this.data = data;
}
diff --git a/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASHelper.java b/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASHelper.java
index 756478d3..00528762 100644
--- a/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASHelper.java
+++ b/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASHelper.java
@@ -1,5 +1,23 @@
+/*
+ * Copyright 2012 by A-SIT, Secure Information Technology Center Austria
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://joinup.ec.europa.eu/software/page/eupl
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ */
package at.asit.pdfover.signer.pdfas;
+//Imports
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import at.asit.pdfover.signator.SignatureException;
import at.gv.egiz.pdfas.api.PdfAs;
import at.gv.egiz.pdfas.api.exceptions.PdfAsException;
@@ -7,11 +25,15 @@ import at.gv.egiz.pdfas.api.internal.PdfAsInternal;
/**
* Encapsulates PDF AS API Object to need just one initialization
- * @author afitzek
*/
public class PDFASHelper {
/**
+ * SFL4J Logger instance
+ **/
+ private static final Logger log = LoggerFactory.getLogger(PDFASHelper.class);
+
+ /**
* PDF AS Object
*/
private static PdfAs pdfAs = null;
diff --git a/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASSLRequest.java b/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASSLRequest.java
index 7130f53a..3c03a018 100644
--- a/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASSLRequest.java
+++ b/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASSLRequest.java
@@ -1,12 +1,43 @@
+/*
+ * Copyright 2012 by A-SIT, Secure Information Technology Center Austria
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://joinup.ec.europa.eu/software/page/eupl
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ */
package at.asit.pdfover.signer.pdfas;
+// Imports
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import at.asit.pdfover.signator.DocumentSource;
import at.asit.pdfover.signator.SLRequest;
+/**
+ * PDF - AS Security Layer Request implementation
+ */
public class PDFASSLRequest implements SLRequest {
+ /**
+ * SFL4J Logger instance
+ **/
+ private static final Logger log = LoggerFactory.getLogger(PDFASSLRequest.class);
+
+ /**
+ * Default constructor
+ * @param slRequest
+ */
public PDFASSLRequest(String slRequest) {
- /// Analyze Request ...
+ //TODO: Analyze Request ...
}
@Override
diff --git a/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASSignerFactory.java b/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASSignerFactory.java
index eaf9637f..94c13412 100644
--- a/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASSignerFactory.java
+++ b/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASSignerFactory.java
@@ -1,10 +1,36 @@
+/*
+ * Copyright 2012 by A-SIT, Secure Information Technology Center Austria
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://joinup.ec.europa.eu/software/page/eupl
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ */
package at.asit.pdfover.signer.pdfas;
+//Imports
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import at.asit.pdfover.signator.Signer;
import at.asit.pdfover.signator.SignerFactory;
+/**
+ * Factory class for PDF-AS Signer
+ */
public class PDFASSignerFactory extends SignerFactory {
+ /**
+ * SFL4J Logger instance
+ **/
+ private static final Logger log = LoggerFactory.getLogger(PDFASSignerFactory.class);
+
@Override
public Signer createSigner() {
return new PDFASSigner();
diff --git a/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASSigningState.java b/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASSigningState.java
index 8b8216c6..1d52a27f 100644
--- a/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASSigningState.java
+++ b/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASSigningState.java
@@ -1,5 +1,23 @@
+/*
+ * Copyright 2012 by A-SIT, Secure Information Technology Center Austria
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://joinup.ec.europa.eu/software/page/eupl
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ */
package at.asit.pdfover.signer.pdfas;
+//Imports
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import at.asit.pdfover.signator.SLRequest;
import at.asit.pdfover.signator.SLResponse;
import at.asit.pdfover.signator.SigningState;
@@ -7,11 +25,15 @@ import at.gv.egiz.pdfas.api.sign.SignatureDetailInformation;
/**
* Signing State for PDFAS Wrapper
- * @author afitzek
*/
public class PDFASSigningState implements SigningState {
/**
+ * SFL4J Logger instance
+ **/
+ private static final Logger log = LoggerFactory.getLogger(PDFASSigningState.class);
+
+ /**
* The Signature Layer request
*/
protected SLRequest slrequest;
@@ -52,34 +74,67 @@ public class PDFASSigningState implements SigningState {
// PDF AS Specific stuff
// ----------------------------------------
+ /**
+ * signature detail information
+ */
protected SignatureDetailInformation signatureDetailInformation;
+ /**
+ * PDF - AS sign parameters
+ */
protected at.gv.egiz.pdfas.api.sign.SignParameters signParameters;
+ /**
+ * Signature parameters
+ */
protected PdfAsSignatureParameter pdfAsSignatureParameter;
+ /**
+ * Gets PDF - AS Signature Parameters
+ * @return PdfAsSignatureParameter
+ */
public PdfAsSignatureParameter getPdfAsSignatureParameter() {
- return pdfAsSignatureParameter;
+ return this.pdfAsSignatureParameter;
}
+ /**
+ * Sets PDF - AS Signature Parameters
+ * @param pdfAsSignatureParameter
+ */
public void setPdfAsSignatureParameter(
PdfAsSignatureParameter pdfAsSignatureParameter) {
this.pdfAsSignatureParameter = pdfAsSignatureParameter;
}
+ /**
+ * Get Sign Parameters
+ * @return SignParameters
+ */
public at.gv.egiz.pdfas.api.sign.SignParameters getSignParameters() {
- return signParameters;
+ return this.signParameters;
}
+ /**
+ * Sets sign Parameter
+ * @param signParameters
+ */
public void setSignParameters(
at.gv.egiz.pdfas.api.sign.SignParameters signParameters) {
this.signParameters = signParameters;
}
+ /**
+ * Gets the signature detail information
+ * @return SignatureDetailInformation
+ */
public SignatureDetailInformation getSignatureDetailInformation() {
- return signatureDetailInformation;
+ return this.signatureDetailInformation;
}
+ /**
+ * Sets the SignatureDetailInformation
+ * @param signatureDetailInformation
+ */
public void setSignatureDetailInformation(
SignatureDetailInformation signatureDetailInformation) {
this.signatureDetailInformation = signatureDetailInformation;
diff --git a/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PdfAsSignatureParameter.java b/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PdfAsSignatureParameter.java
index 7332a13e..bd324e9f 100644
--- a/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PdfAsSignatureParameter.java
+++ b/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PdfAsSignatureParameter.java
@@ -1,23 +1,57 @@
+/*
+ * Copyright 2012 by A-SIT, Secure Information Technology Center Austria
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://joinup.ec.europa.eu/software/page/eupl
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ */
package at.asit.pdfover.signer.pdfas;
+//Imports
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import at.asit.pdfover.signator.SignatureDimension;
import at.asit.pdfover.signator.SignatureParameter;
import at.gv.egiz.pdfas.api.sign.pos.SignaturePositioning;
import at.gv.egiz.pdfas.api.io.DataSource;
+/**
+ * Implementation of SignatureParameter specific for PDF - AS Library
+ */
public class PdfAsSignatureParameter extends SignatureParameter {
+ /**
+ * SFL4J Logger instance
+ **/
+ private static final Logger log = LoggerFactory.getLogger(PdfAsSignatureParameter.class);
+
@Override
public SignatureDimension getPlaceholderDimension() {
// TODO Auto-generated method stub
return null;
}
+ /**
+ * Gets the PDFAS Positioning
+ * @return SignaturePositioning
+ */
public SignaturePositioning getPDFASPositioning() {
// TODO: implement Signature creation
return new SignaturePositioning();
}
+ /**
+ * Gets PDF - AS specific data source
+ * @return ByteArrayPDFASDataSource
+ */
public DataSource getPDFASDataSource() {
// TODO: implement Signature creation
return new ByteArrayPDFASDataSource(null);