diff options
Diffstat (limited to 'pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/ws')
4 files changed, 96 insertions, 0 deletions
diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/ws/PDFASSignParameters.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/ws/PDFASSignParameters.java new file mode 100644 index 00000000..4658372b --- /dev/null +++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/ws/PDFASSignParameters.java @@ -0,0 +1,43 @@ +package at.gv.egiz.pdfas.web.ws; + +import java.io.Serializable; + +public class PDFASSignParameters implements Serializable { + + /** + * + */ + private static final long serialVersionUID = -2375108993871456465L; + + public enum Connector { + JKS, + MOA + } + + Connector connector; + String position; + String profile; + + + public Connector getConnector() { + return connector; + } + public void setConnector(Connector connector) { + this.connector = connector; + } + public String getPosition() { + return position; + } + public void setPosition(String position) { + this.position = position; + } + public String getProfile() { + return profile; + } + public void setProfile(String profile) { + this.profile = profile; + } + + + +} diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/ws/PDFASSigning.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/ws/PDFASSigning.java new file mode 100644 index 00000000..0b75c0e0 --- /dev/null +++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/ws/PDFASSigning.java @@ -0,0 +1,11 @@ +package at.gv.egiz.pdfas.web.ws; + +import javax.jws.WebService; +import javax.jws.soap.SOAPBinding; +import javax.jws.soap.SOAPBinding.Style; + +@WebService +@SOAPBinding(style = Style.RPC) +public interface PDFASSigning { + public byte[] signPDFDokument(byte[] inputDocument, PDFASSignParameters parameters); +} diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/ws/PDFASSigningImpl.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/ws/PDFASSigningImpl.java new file mode 100644 index 00000000..39c6c24d --- /dev/null +++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/ws/PDFASSigningImpl.java @@ -0,0 +1,34 @@ +package at.gv.egiz.pdfas.web.ws; + +import javax.jws.WebService; +import javax.xml.ws.WebServiceException; +import javax.xml.ws.soap.MTOM; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import at.gv.egiz.pdfas.web.config.WebConfiguration; +import at.gv.egiz.pdfas.web.helper.PdfAsHelper; + +@MTOM +@WebService(endpointInterface = "at.gv.egiz.pdfas.web.ws.PDFASSigning") +public class PDFASSigningImpl implements PDFASSigning { + + private static final Logger logger = LoggerFactory + .getLogger(PDFASSigningImpl.class); + + public byte[] signPDFDokument(byte[] inputDocument, + PDFASSignParameters parameters) { + try { + return PdfAsHelper.synchornousServerSignature(inputDocument, parameters); + } catch(Throwable e) { + logger.error("Server Signature failed.", e); + if(WebConfiguration.isShowErrorDetails()) { + throw new WebServiceException("Server Signature failed.", e); + } else { + throw new WebServiceException("Server Signature failed."); + } + } + } + +} diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/ws/package-info.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/ws/package-info.java new file mode 100644 index 00000000..0ed0acfc --- /dev/null +++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/ws/package-info.java @@ -0,0 +1,8 @@ +/** + * + */ +/** + * @author afitzek + * + */ +package at.gv.egiz.pdfas.web.ws;
\ No newline at end of file |