aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-web/src/main/java
diff options
context:
space:
mode:
authorAlexander Marsalek <amarsalek@iaik.tugraz.at>2021-06-01 12:13:12 +0200
committerAlexander Marsalek <amarsalek@iaik.tugraz.at>2021-06-01 14:38:17 +0200
commit4566ef134c84c31b294ade015bc7e62b9c47ae79 (patch)
treea838565a81a6f13e5a34739d1ed96eadd89faba9 /pdf-as-web/src/main/java
parent90d2ec69b01a5622c462cde538e0c739322a81ba (diff)
parent1263be201c27b6e96cc9975a6dddd5a9f1306c77 (diff)
downloadpdf-as-4-4566ef134c84c31b294ade015bc7e62b9c47ae79.tar.gz
pdf-as-4-4566ef134c84c31b294ade015bc7e62b9c47ae79.tar.bz2
pdf-as-4-4566ef134c84c31b294ade015bc7e62b9c47ae79.zip
Merge branch 'master'
# Conflicts: # pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java # pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/JSONAPIServlet.java # pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/ws/PDFASSigningImpl.java
Diffstat (limited to 'pdf-as-web/src/main/java')
-rw-r--r--pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java11
-rw-r--r--pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/JSONAPIServlet.java3
-rw-r--r--pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/VerifyServlet.java2
-rw-r--r--pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/ws/PDFASSigningImpl.java5
-rw-r--r--pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/ws/PDFASVerificationImpl.java2
5 files changed, 12 insertions, 11 deletions
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 34781461..2f7c9323 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
@@ -301,7 +301,7 @@ public class PdfAsHelper {
return sb.toString();
}
- public static List<VerifyResult> synchornousVerify(
+ public static List<VerifyResult> synchronousVerify(
HttpServletRequest request, HttpServletResponse response,
byte[] pdfData) throws Exception {
String signidxString = PdfAsParameterExtractor.getSigIdx(request);
@@ -332,9 +332,9 @@ public class PdfAsHelper {
return results;
}
- public static List<VerifyResult> synchornousVerify(byte[] pdfData,
- int signIdx, SignatureVerificationLevel lvl,
- Map<String, String> preProcessor) throws Exception {
+ public static List<VerifyResult> synchronousVerify(byte[] pdfData,
+ int signIdx, SignatureVerificationLevel lvl,
+ Map<String, String> preProcessor) throws Exception {
logger.debug("Verifing Signature index: " + signIdx);
Configuration config = pdfAs.getConfiguration();
@@ -528,6 +528,7 @@ public class PdfAsHelper {
*/
public static PDFASSignResponse synchronousServerSignature(byte[] pdfData,
PDFASSignParameters params, Map<String, String> dynamicSignatureBlockArguments) throws Exception {
+
Configuration config = pdfAs.getConfiguration();
if (WebConfiguration.isAllowExtOverwrite() && params.getOverrides() != null) {
@@ -1290,7 +1291,7 @@ public class PdfAsHelper {
baos.close();
PDFASVerificationResponse verResponse = new PDFASVerificationResponse();
- List<VerifyResult> verResults = PdfAsHelper.synchornousVerify(
+ List<VerifyResult> verResults = PdfAsHelper.synchronousVerify(
baos.toByteArray(), -2,
PdfAsHelper.getVerificationLevel(request), null);
diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/JSONAPIServlet.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/JSONAPIServlet.java
index 78bb3c69..641c09e7 100644
--- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/JSONAPIServlet.java
+++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/JSONAPIServlet.java
@@ -154,14 +154,13 @@ public class JSONAPIServlet extends HttpServlet {
if (PDFASSignParameters.Connector.MOA.equals(connectorEnum)
|| PDFASSignParameters.Connector.JKS.equals(connectorEnum)) {
// Plain server based signatures!!
-
PDFASSignResponse pdfasSignResponse = PdfAsHelper.synchronousServerSignature(
inputDocument, parameters, signatureBlockParametersMap);
VerifyResult verifyResult = null;
List<VerifyResult> verResults = PdfAsHelper
- .synchornousVerify(
+ .synchronousVerify(
pdfasSignResponse.getSignedPDF(),
-1,
VerifyParameter.SignatureVerificationLevel.INTEGRITY_ONLY_VERIFICATION,
diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/VerifyServlet.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/VerifyServlet.java
index a8beffeb..bc5f2e2d 100644
--- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/VerifyServlet.java
+++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/VerifyServlet.java
@@ -304,7 +304,7 @@ public class VerifyServlet extends HttpServlet {
logger.debug("Format: " + format);
- List<VerifyResult> results = PdfAsHelper.synchornousVerify(pdfData, -1, lvl,
+ List<VerifyResult> results = PdfAsHelper.synchronousVerify(pdfData, -1, lvl,
PdfAsParameterExtractor.getPreProcessorMap(request));
PdfAsHelper.setVerificationResult(request, results);
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 ccbaf4fb..531abdf1 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
@@ -107,12 +107,13 @@ public class PDFASSigningImpl implements PDFASSigning {
response = PdfAsHelper.synchronousServerSignature(
request.getInputData(), request.getParameters(), request.getSignatureBlockParameters());
+
VerifyResult verifyResult = null;
if (request.getVerificationLevel() != null &&
request.getVerificationLevel().equals(
VerificationLevel.FULL_CERT_PATH)) {
List<VerifyResult> verResults = PdfAsHelper
- .synchornousVerify(
+ .synchronousVerify(
response.getSignedPDF(),
-1,
SignatureVerificationLevel.FULL_VERIFICATION,
@@ -125,7 +126,7 @@ public class PDFASSigningImpl implements PDFASSigning {
verifyResult = verResults.get(verResults.size() - 1);
} else {
List<VerifyResult> verResults = PdfAsHelper
- .synchornousVerify(
+ .synchronousVerify(
response.getSignedPDF(),
-1,
SignatureVerificationLevel.INTEGRITY_ONLY_VERIFICATION,
diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/ws/PDFASVerificationImpl.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/ws/PDFASVerificationImpl.java
index bfdc3bd3..b1bca4ba 100644
--- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/ws/PDFASVerificationImpl.java
+++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/ws/PDFASVerificationImpl.java
@@ -71,7 +71,7 @@ public class PDFASVerificationImpl implements PDFASVerification {
statisticEvent.setProfileId(null);
statisticEvent.setDevice(request.getVerificationLevel().toString());
- List<VerifyResult> results = PdfAsHelper.synchornousVerify(
+ List<VerifyResult> results = PdfAsHelper.synchronousVerify(
request.getInputData(), sigIdx, lvl, preProcessor);
for(int i = 0; i < results.size(); i++) {