From f34d3f0dc4bd88a8a54f5707a4f4fa3b845637a5 Mon Sep 17 00:00:00 2001 From: tkellner Date: Wed, 10 Apr 2013 18:51:43 +0000 Subject: 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 --- .../.settings/org.eclipse.jdt.ui.prefs | 3 ++ .../signer/pdfas/ByteArrayPDFASDataSource.java | 34 ++++++++++++ .../at/asit/pdfover/signer/pdfas/PDFASHelper.java | 24 ++++++++- .../asit/pdfover/signer/pdfas/PDFASSLRequest.java | 33 +++++++++++- .../pdfover/signer/pdfas/PDFASSignerFactory.java | 26 +++++++++ .../pdfover/signer/pdfas/PDFASSigningState.java | 63 ++++++++++++++++++++-- .../signer/pdfas/PdfAsSignatureParameter.java | 34 ++++++++++++ 7 files changed, 211 insertions(+), 6 deletions(-) create mode 100644 pdf-over-signer/pdf-over-sigpdfas/.settings/org.eclipse.jdt.ui.prefs (limited to 'pdf-over-signer') 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= 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,10 +25,14 @@ 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 */ 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,10 +25,14 @@ 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 */ @@ -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); -- cgit v1.2.3