summaryrefslogtreecommitdiff
path: root/trunk/pdf-over-signer/pdf-over-sigpdfas/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'trunk/pdf-over-signer/pdf-over-sigpdfas/src/main')
-rw-r--r--trunk/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/ByteArrayPDFASDataSource.java34
-rw-r--r--trunk/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASHelper.java24
-rw-r--r--trunk/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASSLRequest.java33
-rw-r--r--trunk/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASSignerFactory.java26
-rw-r--r--trunk/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASSigningState.java63
-rw-r--r--trunk/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PdfAsSignatureParameter.java34
6 files changed, 208 insertions, 6 deletions
diff --git a/trunk/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/ByteArrayPDFASDataSource.java b/trunk/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/ByteArrayPDFASDataSource.java
index 0fa23192..31e522db 100644
--- a/trunk/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/ByteArrayPDFASDataSource.java
+++ b/trunk/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/trunk/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASHelper.java b/trunk/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASHelper.java
index 756478d3..00528762 100644
--- a/trunk/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASHelper.java
+++ b/trunk/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/trunk/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASSLRequest.java b/trunk/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASSLRequest.java
index 7130f53a..3c03a018 100644
--- a/trunk/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASSLRequest.java
+++ b/trunk/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/trunk/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASSignerFactory.java b/trunk/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASSignerFactory.java
index eaf9637f..94c13412 100644
--- a/trunk/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASSignerFactory.java
+++ b/trunk/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/trunk/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASSigningState.java b/trunk/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASSigningState.java
index 8b8216c6..1d52a27f 100644
--- a/trunk/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASSigningState.java
+++ b/trunk/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/trunk/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PdfAsSignatureParameter.java b/trunk/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PdfAsSignatureParameter.java
index 7332a13e..bd324e9f 100644
--- a/trunk/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PdfAsSignatureParameter.java
+++ b/trunk/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);