diff options
author | Andreas Fitzek <andreas.fitzek@iaik.tugraz.at> | 2014-07-15 10:26:49 +0200 |
---|---|---|
committer | Andreas Fitzek <andreas.fitzek@iaik.tugraz.at> | 2014-07-15 10:26:49 +0200 |
commit | 6f688b64b1520025d0cb574fbd8e309d1a5ffb96 (patch) | |
tree | cf84e9d188a2751aed706898008159efd7242440 | |
parent | 8eecd5504d82b4827dda5b0549e0662051f37df2 (diff) | |
download | pdf-as-4-6f688b64b1520025d0cb574fbd8e309d1a5ffb96.tar.gz pdf-as-4-6f688b64b1520025d0cb574fbd8e309d1a5ffb96.tar.bz2 pdf-as-4-6f688b64b1520025d0cb574fbd8e309d1a5ffb96.zip |
Moved signer certificate info PDFAS Verification Response
4 files changed, 19 insertions, 14 deletions
diff --git a/pdf-as-common/src/main/java/at/gv/egiz/pdfas/api/ws/PDFASSignResponse.java b/pdf-as-common/src/main/java/at/gv/egiz/pdfas/api/ws/PDFASSignResponse.java index 19517a13..3e8a360b 100644 --- a/pdf-as-common/src/main/java/at/gv/egiz/pdfas/api/ws/PDFASSignResponse.java +++ b/pdf-as-common/src/main/java/at/gv/egiz/pdfas/api/ws/PDFASSignResponse.java @@ -39,7 +39,6 @@ public class PDFASSignResponse implements Serializable { String requestID; String error; byte[] signedPDF; - byte[] signerCertificate; PDFASVerificationResponse verificationResponse; String redirectUrl; @@ -59,14 +58,6 @@ public class PDFASSignResponse implements Serializable { this.signedPDF = signedPDF; } - @XmlElement(required = false, nillable = false, name="signerCertificate") - public byte[] getSignerCertificate() { - return signerCertificate; - } - public void setSignerCertificate(byte[] signerCertificate) { - this.signerCertificate = signerCertificate; - } - @XmlElement(required = false, nillable = false, name="verificationResponse") public PDFASVerificationResponse getVerificationResponse() { return verificationResponse; diff --git a/pdf-as-common/src/main/java/at/gv/egiz/pdfas/api/ws/PDFASVerificationResponse.java b/pdf-as-common/src/main/java/at/gv/egiz/pdfas/api/ws/PDFASVerificationResponse.java index c4fb438d..720b4438 100644 --- a/pdf-as-common/src/main/java/at/gv/egiz/pdfas/api/ws/PDFASVerificationResponse.java +++ b/pdf-as-common/src/main/java/at/gv/egiz/pdfas/api/ws/PDFASVerificationResponse.java @@ -15,6 +15,7 @@ public class PDFASVerificationResponse implements Serializable { int valueCode; int certificateCode; + byte[] signerCertificate; @XmlElement(required = true, nillable = false, name="valueCode") public int getValueCode() { @@ -31,4 +32,12 @@ public class PDFASVerificationResponse implements Serializable { public void setCertificateCode(int certificateCode) { this.certificateCode = certificateCode; } + + @XmlElement(required = false, nillable = false, name="signerCertificate") + public byte[] getSignerCertificate() { + return signerCertificate; + } + public void setSignerCertificate(byte[] signerCertificate) { + this.signerCertificate = signerCertificate; + } } diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java index 8ec5d6fe..ce51515e 100644 --- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java +++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java @@ -426,9 +426,14 @@ public class PdfAsHelper { PDFASSignResponse signResponse = new PDFASSignResponse(); signResponse.setSignedPDF(output.getData()); - signResponse.setSignerCertificate(signResult.getSignerCertificate() + + PDFASVerificationResponse verResponse = new PDFASVerificationResponse(); + + verResponse.setSignerCertificate(signResult.getSignerCertificate() .getEncoded()); + signResponse.setVerificationResponse(verResponse); + return signResponse; } 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 index cca66f82..02c1af5e 100644 --- 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 @@ -84,7 +84,7 @@ public class PDFASSigningImpl implements PDFASSigning { response = PdfAsHelper.synchornousServerSignature(request.getInputData(), request.getParameters()); - PDFASVerificationResponse verResponse = new PDFASVerificationResponse(); + VerifyResult verifyResult = null; if(request.getVerificationLevel().equals(VerificationLevel.FULL_CERT_PATH)) { List<VerifyResult> verResults = PdfAsHelper.synchornousVerify(response.getSignedPDF(), -1, @@ -104,9 +104,9 @@ public class PDFASSigningImpl implements PDFASSigning { verifyResult = verResults.get(0); } - verResponse.setCertificateCode(verifyResult.getCertificateCheck().getCode()); - verResponse.setValueCode(verifyResult.getValueCheckCode().getCode()); - response.setVerificationResponse(verResponse); + response.getVerificationResponse().setCertificateCode(verifyResult.getCertificateCheck().getCode()); + response.getVerificationResponse().setValueCode(verifyResult.getValueCheckCode().getCode()); + } else { // Signatures with user interaction!! String id = RequestStore.getInstance().createNewStoreEntry(request); |