summaryrefslogtreecommitdiff
path: root/pdf-over-signator/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'pdf-over-signator/src/main/java')
-rw-r--r--pdf-over-signator/src/main/java/at/asit/pdfover/signator/BKUs.java2
-rw-r--r--pdf-over-signator/src/main/java/at/asit/pdfover/signator/BkuSlConnector.java4
-rw-r--r--pdf-over-signator/src/main/java/at/asit/pdfover/signator/ByteArrayDocumentSource.java4
-rw-r--r--pdf-over-signator/src/main/java/at/asit/pdfover/signator/CachedFileNameEmblem.java34
-rw-r--r--pdf-over-signator/src/main/java/at/asit/pdfover/signator/DocumentSource.java2
-rw-r--r--pdf-over-signator/src/main/java/at/asit/pdfover/signator/FileNameEmblem.java6
-rw-r--r--pdf-over-signator/src/main/java/at/asit/pdfover/signator/PDFFileDocumentSource.java10
-rw-r--r--pdf-over-signator/src/main/java/at/asit/pdfover/signator/SLRequest.java4
-rw-r--r--pdf-over-signator/src/main/java/at/asit/pdfover/signator/SLResponse.java8
-rw-r--r--pdf-over-signator/src/main/java/at/asit/pdfover/signator/SignResult.java4
-rw-r--r--pdf-over-signator/src/main/java/at/asit/pdfover/signator/SignResultImpl.java2
-rw-r--r--pdf-over-signator/src/main/java/at/asit/pdfover/signator/SignatureDimension.java2
-rw-r--r--pdf-over-signator/src/main/java/at/asit/pdfover/signator/SignatureException.java6
-rw-r--r--pdf-over-signator/src/main/java/at/asit/pdfover/signator/SignatureParameter.java32
-rw-r--r--pdf-over-signator/src/main/java/at/asit/pdfover/signator/SignaturePosition.java14
-rw-r--r--pdf-over-signator/src/main/java/at/asit/pdfover/signator/Signer.java6
-rw-r--r--pdf-over-signator/src/main/java/at/asit/pdfover/signator/SigningState.java2
17 files changed, 71 insertions, 71 deletions
diff --git a/pdf-over-signator/src/main/java/at/asit/pdfover/signator/BKUs.java b/pdf-over-signator/src/main/java/at/asit/pdfover/signator/BKUs.java
index 8d936d3c..be3eec4f 100644
--- a/pdf-over-signator/src/main/java/at/asit/pdfover/signator/BKUs.java
+++ b/pdf-over-signator/src/main/java/at/asit/pdfover/signator/BKUs.java
@@ -17,7 +17,7 @@ package at.asit.pdfover.signator;
/**
* Enumeration of available BKU types
- *
+ *
*/
public enum BKUs {
/** Local BKU */
diff --git a/pdf-over-signator/src/main/java/at/asit/pdfover/signator/BkuSlConnector.java b/pdf-over-signator/src/main/java/at/asit/pdfover/signator/BkuSlConnector.java
index bd908b1d..14e54133 100644
--- a/pdf-over-signator/src/main/java/at/asit/pdfover/signator/BkuSlConnector.java
+++ b/pdf-over-signator/src/main/java/at/asit/pdfover/signator/BkuSlConnector.java
@@ -18,13 +18,13 @@ package at.asit.pdfover.signator;
// Imports
/**
- *
+ *
*/
public interface BkuSlConnector {
/**
* @param request
* @return SL Response
- * @throws SignatureException
+ * @throws SignatureException
*/
public SLResponse handleSLRequest(SLRequest request) throws SignatureException;
}
diff --git a/pdf-over-signator/src/main/java/at/asit/pdfover/signator/ByteArrayDocumentSource.java b/pdf-over-signator/src/main/java/at/asit/pdfover/signator/ByteArrayDocumentSource.java
index 8ff79374..d0fb6cfe 100644
--- a/pdf-over-signator/src/main/java/at/asit/pdfover/signator/ByteArrayDocumentSource.java
+++ b/pdf-over-signator/src/main/java/at/asit/pdfover/signator/ByteArrayDocumentSource.java
@@ -28,7 +28,7 @@ public class ByteArrayDocumentSource implements DocumentSource {
* Document content
*/
protected byte[] data;
-
+
/**
* Constructor with byte[] content
* @param data the document content
@@ -36,7 +36,7 @@ public class ByteArrayDocumentSource implements DocumentSource {
public ByteArrayDocumentSource(byte[] data) {
this.data = data;
}
-
+
@Override
public InputStream getInputStream() {
return new ByteArrayInputStream(this.data);
diff --git a/pdf-over-signator/src/main/java/at/asit/pdfover/signator/CachedFileNameEmblem.java b/pdf-over-signator/src/main/java/at/asit/pdfover/signator/CachedFileNameEmblem.java
index 51d094eb..582b44b8 100644
--- a/pdf-over-signator/src/main/java/at/asit/pdfover/signator/CachedFileNameEmblem.java
+++ b/pdf-over-signator/src/main/java/at/asit/pdfover/signator/CachedFileNameEmblem.java
@@ -45,7 +45,7 @@ import com.drew.metadata.exif.ExifDirectoryBase;
import com.drew.metadata.exif.ExifIFD0Directory;
/**
- *
+ *
*/
public class CachedFileNameEmblem implements Emblem {
/**
@@ -54,13 +54,13 @@ public class CachedFileNameEmblem implements Emblem {
private static final Logger log = LoggerFactory
.getLogger(CachedFileNameEmblem.class);
- private final String fileDir = System.getProperty("user.home") + File.separator + ".pdf-over"; //$NON-NLS-1$ //$NON-NLS-2$
- private final String imgFileName = ".emblem"; //$NON-NLS-1$
- private final String imgFileExt = "png"; //$NON-NLS-1$
- private final String propFileName = ".emblem.properties"; //$NON-NLS-1$
+ private final String fileDir = System.getProperty("user.home") + File.separator + ".pdf-over"; // //
+ private final String imgFileName = ".emblem"; //
+ private final String imgFileExt = "png"; //
+ private final String propFileName = ".emblem.properties"; //
- private final String imgProp = "IMG"; //$NON-NLS-1$
- private final String hshProp = "HSH"; //$NON-NLS-1$
+ private final String imgProp = "IMG"; //
+ private final String hshProp = "HSH"; //
private final int maxWidth = 480;
private final int maxHeight = 600;
@@ -186,7 +186,7 @@ public class CachedFileNameEmblem implements Emblem {
BufferedImage result = img;
if (width != owidth || height == oheight) {
//scale image
- log.debug("Scaling emblem: " + owidth + "x" + oheight + " to " + width + "x" + height); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ log.debug("Scaling emblem: " + owidth + "x" + oheight + " to " + width + "x" + height); // // // //
result = new BufferedImage(width, height, img.getType() == 0 ? BufferedImage.TYPE_INT_ARGB : img.getType());
Graphics2D g = result.createGraphics();
g.drawImage(img, 0, 0, width, height, null);
@@ -202,7 +202,7 @@ public class CachedFileNameEmblem implements Emblem {
public String getFileName() {
String emblemImg = this.fileName;
String emblemHsh = null;
- String cachedEmblemFileName = this.fileDir + File.separator + this.imgFileName + "." + this.imgFileExt; //$NON-NLS-1$
+ String cachedEmblemFileName = this.fileDir + File.separator + this.imgFileName + "." + this.imgFileExt; //
if (emblemImg == null || !(new File(emblemImg).exists()))
return null;
@@ -215,13 +215,13 @@ public class CachedFileNameEmblem implements Emblem {
if (emblemImg.equals(emblemProps.getProperty(this.imgProp))) {
emblemHsh = getFileHash(emblemImg);
if (emblemHsh.equals(emblemProps.getProperty(this.hshProp))) {
- log.debug("Emblem cache hit: " + cachedEmblemFileName); //$NON-NLS-1$
- return cachedEmblemFileName; //$NON-NLS-1$
+ log.debug("Emblem cache hit: " + cachedEmblemFileName); //
+ return cachedEmblemFileName; //
}
}
- log.debug("Emblem cache miss"); //$NON-NLS-1$
+ log.debug("Emblem cache miss"); //
} catch (Exception e) {
- log.warn("Can't load emblem cache", e); //$NON-NLS-1$
+ log.warn("Can't load emblem cache", e); //
}
try {
@@ -236,12 +236,12 @@ public class CachedFileNameEmblem implements Emblem {
img = fixImage(img, imgFile);
img = scaleImage(img, this.maxWidth, this.maxHeight);
- File file = new File(this.fileDir, this.imgFileName + "." + this.imgFileExt); //$NON-NLS-1$
+ File file = new File(this.fileDir, this.imgFileName + "." + this.imgFileExt); //
ImageIO.write(img, this.imgFileExt, file); // ignore returned boolean
OutputStream out = new FileOutputStream(new File(this.fileDir, this.propFileName));
emblemProps.store(out, null);
} catch (IOException e) {
- log.error("Can't save emblem cache", e); //$NON-NLS-1$
+ log.error("Can't save emblem cache", e); //
return this.fileName;
}
return cachedEmblemFileName;
@@ -261,12 +261,12 @@ public class CachedFileNameEmblem implements Emblem {
*/
public String getOriginalFileHash() {
if (this.fileName == null || !(new File(this.fileName).exists()))
- return ""; //$NON-NLS-1$
+ return ""; //
try {
return getFileHash(this.fileName);
} catch (IOException e) {
log.debug("Error getting file hash", e);
- return ""; //$NON-NLS-1$
+ return ""; //
}
}
}
diff --git a/pdf-over-signator/src/main/java/at/asit/pdfover/signator/DocumentSource.java b/pdf-over-signator/src/main/java/at/asit/pdfover/signator/DocumentSource.java
index 361c31a2..3c94f104 100644
--- a/pdf-over-signator/src/main/java/at/asit/pdfover/signator/DocumentSource.java
+++ b/pdf-over-signator/src/main/java/at/asit/pdfover/signator/DocumentSource.java
@@ -26,7 +26,7 @@ public interface DocumentSource {
/**
* Gets the InputStream for this Document
* @return InputStream for the document
- * @throws IOException
+ * @throws IOException
*/
public InputStream getInputStream() throws IOException;
diff --git a/pdf-over-signator/src/main/java/at/asit/pdfover/signator/FileNameEmblem.java b/pdf-over-signator/src/main/java/at/asit/pdfover/signator/FileNameEmblem.java
index 320de5fa..f080fd5d 100644
--- a/pdf-over-signator/src/main/java/at/asit/pdfover/signator/FileNameEmblem.java
+++ b/pdf-over-signator/src/main/java/at/asit/pdfover/signator/FileNameEmblem.java
@@ -20,7 +20,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
- *
+ *
*/
public class FileNameEmblem implements Emblem {
/**
@@ -31,7 +31,7 @@ public class FileNameEmblem implements Emblem {
.getLogger(FileNameEmblem.class);
private String fileName = null;
-
+
/**
* Constructor
* @param filename
@@ -39,7 +39,7 @@ public class FileNameEmblem implements Emblem {
public FileNameEmblem(String filename) {
this.fileName = filename;
}
-
+
/* (non-Javadoc)
* @see at.asit.pdfover.signator.Emblem#getFileName()
*/
diff --git a/pdf-over-signator/src/main/java/at/asit/pdfover/signator/PDFFileDocumentSource.java b/pdf-over-signator/src/main/java/at/asit/pdfover/signator/PDFFileDocumentSource.java
index c33dfae3..b85a65f2 100644
--- a/pdf-over-signator/src/main/java/at/asit/pdfover/signator/PDFFileDocumentSource.java
+++ b/pdf-over-signator/src/main/java/at/asit/pdfover/signator/PDFFileDocumentSource.java
@@ -25,7 +25,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
- *
+ *
*/
public class PDFFileDocumentSource implements DocumentSource {
/**
@@ -35,11 +35,11 @@ public class PDFFileDocumentSource implements DocumentSource {
.getLogger(PDFFileDocumentSource.class);
private File file;
-
+
private byte[] data = null;
-
+
private int len = 0;
-
+
/**
* Default constructor
* @param file
@@ -47,7 +47,7 @@ public class PDFFileDocumentSource implements DocumentSource {
public PDFFileDocumentSource(File file) {
this.file = file;
}
-
+
/* (non-Javadoc)
* @see at.asit.pdfover.signator.DocumentSource#getInputStream()
*/
diff --git a/pdf-over-signator/src/main/java/at/asit/pdfover/signator/SLRequest.java b/pdf-over-signator/src/main/java/at/asit/pdfover/signator/SLRequest.java
index 5fd9c756..95aee1e0 100644
--- a/pdf-over-signator/src/main/java/at/asit/pdfover/signator/SLRequest.java
+++ b/pdf-over-signator/src/main/java/at/asit/pdfover/signator/SLRequest.java
@@ -48,7 +48,7 @@ public class SLRequest {
/**
* Gets the signature data for this request
- *
+ *
* @return The document source
*/
public DocumentSource getSignatureData()
@@ -58,7 +58,7 @@ public class SLRequest {
/**
* Gets the request String
- *
+ *
* @return the request
*/
public String getRequest() {
diff --git a/pdf-over-signator/src/main/java/at/asit/pdfover/signator/SLResponse.java b/pdf-over-signator/src/main/java/at/asit/pdfover/signator/SLResponse.java
index 12a1c194..1b7abf1c 100644
--- a/pdf-over-signator/src/main/java/at/asit/pdfover/signator/SLResponse.java
+++ b/pdf-over-signator/src/main/java/at/asit/pdfover/signator/SLResponse.java
@@ -23,13 +23,13 @@ import org.slf4j.LoggerFactory;
* Security Layer response
*/
public class SLResponse {
-
+
/**
* SLF4J Logger instance
**/
@SuppressWarnings("unused")
private static Logger log = LoggerFactory.getLogger(SLResponse.class);
-
+
private String response;
private String server;
@@ -59,7 +59,7 @@ public class SLResponse {
private String userAgent;
private String signaturLayout;
-
+
/**
* Create a new Security Layer response
* @param response the SLResponse
@@ -73,7 +73,7 @@ public class SLResponse {
this.userAgent = userAgent;
this.signaturLayout = signaturLayout;
}
-
+
/**
* Get the Security Layer response text
* @return the Security Layer response text
diff --git a/pdf-over-signator/src/main/java/at/asit/pdfover/signator/SignResult.java b/pdf-over-signator/src/main/java/at/asit/pdfover/signator/SignResult.java
index 1c0c5818..9f9b591c 100644
--- a/pdf-over-signator/src/main/java/at/asit/pdfover/signator/SignResult.java
+++ b/pdf-over-signator/src/main/java/at/asit/pdfover/signator/SignResult.java
@@ -22,12 +22,12 @@ import java.security.cert.X509Certificate;
*/
public interface SignResult {
- /**
+ /**
* Getter of the property <tt>signaturePosition</tt>
* @return Returns the signaturePosition.
*/
public SignaturePosition getSignaturePosition();
-
+
/**
* Gets the signed Document
* @return Returns the documentSource.
diff --git a/pdf-over-signator/src/main/java/at/asit/pdfover/signator/SignResultImpl.java b/pdf-over-signator/src/main/java/at/asit/pdfover/signator/SignResultImpl.java
index 3fb15bba..35620110 100644
--- a/pdf-over-signator/src/main/java/at/asit/pdfover/signator/SignResultImpl.java
+++ b/pdf-over-signator/src/main/java/at/asit/pdfover/signator/SignResultImpl.java
@@ -49,7 +49,7 @@ public class SignResultImpl implements SignResult {
public void setSignerCertificate(X509Certificate x509Certificate) {
this.certificate = x509Certificate;
}
-
+
/**
* Set the signature position
* @param postion the signature position
diff --git a/pdf-over-signator/src/main/java/at/asit/pdfover/signator/SignatureDimension.java b/pdf-over-signator/src/main/java/at/asit/pdfover/signator/SignatureDimension.java
index 3b5c2969..877c9386 100644
--- a/pdf-over-signator/src/main/java/at/asit/pdfover/signator/SignatureDimension.java
+++ b/pdf-over-signator/src/main/java/at/asit/pdfover/signator/SignatureDimension.java
@@ -67,7 +67,7 @@ public class SignatureDimension {
public int getWidth() {
return this.width;
}
-
+
/**
* Sets the height for the dimension
* @param height
diff --git a/pdf-over-signator/src/main/java/at/asit/pdfover/signator/SignatureException.java b/pdf-over-signator/src/main/java/at/asit/pdfover/signator/SignatureException.java
index 8feaee56..0ac6534b 100644
--- a/pdf-over-signator/src/main/java/at/asit/pdfover/signator/SignatureException.java
+++ b/pdf-over-signator/src/main/java/at/asit/pdfover/signator/SignatureException.java
@@ -23,10 +23,10 @@ package at.asit.pdfover.signator;
public class SignatureException extends Exception {
/**
- *
+ *
*/
private static final long serialVersionUID = 711578398780816710L;
-
+
/**
* Empty constructor
@@ -42,7 +42,7 @@ public class SignatureException extends Exception {
public SignatureException(Throwable cause) {
super(cause);
}
-
+
/**
* Constructor with message
* @param msg the message
diff --git a/pdf-over-signator/src/main/java/at/asit/pdfover/signator/SignatureParameter.java b/pdf-over-signator/src/main/java/at/asit/pdfover/signator/SignatureParameter.java
index b03790b3..14ae6314 100644
--- a/pdf-over-signator/src/main/java/at/asit/pdfover/signator/SignatureParameter.java
+++ b/pdf-over-signator/src/main/java/at/asit/pdfover/signator/SignatureParameter.java
@@ -80,7 +80,7 @@ public abstract class SignatureParameter {
/**
* Getter of the property <tt>signaturePosition</tt>
- *
+ *
* @return Returns the signaturePosition.
*/
public SignaturePosition getSignaturePosition() {
@@ -89,7 +89,7 @@ public abstract class SignatureParameter {
/**
* Setter of the property <tt>signaturePosition</tt>
- *
+ *
* @param signaturePosition
* The signaturePosition to set.
*/
@@ -99,7 +99,7 @@ public abstract class SignatureParameter {
/**
* Getter of the property <tt>signatureLanguage</tt>
- *
+ *
* @return Returns the signatureLanguage.
*/
public String getSignatureLanguage() {
@@ -108,7 +108,7 @@ public abstract class SignatureParameter {
/**
* Setter of the property <tt>signatureLanguage</tt>
- *
+ *
* @param signatureLanguage
* The signatureLanguage to set.
*/
@@ -118,7 +118,7 @@ public abstract class SignatureParameter {
/**
* Getter of the property <tt>signaturePdfACompat</tt>
- *
+ *
* @return Returns the PDF/A compatibility setting.
*/
public boolean getSignaturePdfACompat() {
@@ -127,7 +127,7 @@ public abstract class SignatureParameter {
/**
* Setter of the property <tt>signaturePdfACompat</tt>
- *
+ *
* @param compat
* The the PDF/A compatibility setting to set.
*/
@@ -137,7 +137,7 @@ public abstract class SignatureParameter {
/**
* Getter of the property <tt>keyIdentifier</tt>
- *
+ *
* @return Returns the keyIdentifier.
*/
public String getKeyIdentifier() {
@@ -146,7 +146,7 @@ public abstract class SignatureParameter {
/**
* Setter of the property <tt>keyIdentifier</tt>
- *
+ *
* @param keyIdentifier
* The keyIdentifier to set.
*/
@@ -156,7 +156,7 @@ public abstract class SignatureParameter {
/**
* Getter of the property <tt>documentSource</tt>
- *
+ *
* @return Returns the documentSource.
*/
public DocumentSource getInputDocument() {
@@ -165,7 +165,7 @@ public abstract class SignatureParameter {
/**
* Setter of the property <tt>documentSource</tt>
- *
+ *
* @param inputDocument
* The documentSource to set.
*/
@@ -175,21 +175,21 @@ public abstract class SignatureParameter {
/**
* Gets the Dimension to display the Placeholder
- *
+ *
* @return the placeholder dimensions
*/
public abstract SignatureDimension getPlaceholderDimension();
/**
* Gets the Placeholder image
- *
+ *
* @return the placeholder image
*/
public abstract Image getPlaceholder();
/**
* Gets the Emblem
- *
+ *
* @return the Emblem
*/
public Emblem getEmblem() {
@@ -198,7 +198,7 @@ public abstract class SignatureParameter {
/**
* Sets the Emblem
- *
+ *
* @param emblem
* The new Emblem
*/
@@ -208,7 +208,7 @@ public abstract class SignatureParameter {
/**
* Sets generic properties
- *
+ *
* @param key
* @param value
*/
@@ -216,7 +216,7 @@ public abstract class SignatureParameter {
/**
* Gets generic properties
- *
+ *
* @param key
* @return associated value
*/
diff --git a/pdf-over-signator/src/main/java/at/asit/pdfover/signator/SignaturePosition.java b/pdf-over-signator/src/main/java/at/asit/pdfover/signator/SignaturePosition.java
index edcb263d..5d0f0457 100644
--- a/pdf-over-signator/src/main/java/at/asit/pdfover/signator/SignaturePosition.java
+++ b/pdf-over-signator/src/main/java/at/asit/pdfover/signator/SignaturePosition.java
@@ -26,22 +26,22 @@ public class SignaturePosition {
* The x value of the position
*/
protected float x = 0;
-
+
/**
* The y value of the position
*/
protected float y = 0;
-
+
/**
* The page value of the position
*/
protected int page = 0;
-
+
/**
* Whether automatic positioning is used
*/
protected boolean autoPositioning;
-
+
/**
* Default constructor
* No position given, hence automatic positioning will be used
@@ -49,7 +49,7 @@ public class SignaturePosition {
public SignaturePosition() {
this.autoPositioning = true;
}
-
+
/**
* X - Y Constructor (Page = 0)
* @param x The x value of the position
@@ -59,7 +59,7 @@ public class SignaturePosition {
this.autoPositioning = false;
setPosition(x, y);
}
-
+
/**
* Constructor
* @param x The x value of the signature position
@@ -71,7 +71,7 @@ public class SignaturePosition {
setPosition(x, y);
setPage(page);
}
-
+
/**
* Sets new position
* @param x the new x value
diff --git a/pdf-over-signator/src/main/java/at/asit/pdfover/signator/Signer.java b/pdf-over-signator/src/main/java/at/asit/pdfover/signator/Signer.java
index 3c04da53..5140f0e0 100644
--- a/pdf-over-signator/src/main/java/at/asit/pdfover/signator/Signer.java
+++ b/pdf-over-signator/src/main/java/at/asit/pdfover/signator/Signer.java
@@ -20,7 +20,7 @@ package at.asit.pdfover.signator;
* This class should be extended to support libraries such as PDF-AS or PADES.
*/
public interface Signer {
-
+
/**
* Prepare a signature
* Defines signature parameters, the pdf library prepares the pdf document to sign and
@@ -30,7 +30,7 @@ public interface Signer {
* @throws SignatureException
*/
public SigningState prepare(SignatureParameter parameter) throws SignatureException;
-
+
/**
* Adds the signature to the document.
* The SL Response has to be set in the state
@@ -39,7 +39,7 @@ public interface Signer {
* @throws SignatureException
*/
public SignResult sign(SigningState state) throws SignatureException;
-
+
/**
* Creates new signing profile
* @return The new Profile
diff --git a/pdf-over-signator/src/main/java/at/asit/pdfover/signator/SigningState.java b/pdf-over-signator/src/main/java/at/asit/pdfover/signator/SigningState.java
index 1cfe8065..58263e08 100644
--- a/pdf-over-signator/src/main/java/at/asit/pdfover/signator/SigningState.java
+++ b/pdf-over-signator/src/main/java/at/asit/pdfover/signator/SigningState.java
@@ -19,7 +19,7 @@ package at.asit.pdfover.signator;
* The state of the pdf signing library
*/
public interface SigningState {
-
+
/**
* Gets the Security Layer Request to create the signature
* @return The Signature Request