summaryrefslogtreecommitdiff
path: root/pdf-over-signer/src
diff options
context:
space:
mode:
authorJakob Heher <jakob.heher@iaik.tugraz.at>2022-08-02 13:36:50 +0200
committerJakob Heher <jakob.heher@iaik.tugraz.at>2022-08-02 13:36:50 +0200
commit80f046ab49015cf9cffca11597b9ee57d8a998bc (patch)
treee69444573248da7c435989c2efed2535c98aa84f /pdf-over-signer/src
parentc473a23a59da1593536556bbcb99367fb674c0fa (diff)
downloadpdf-over-80f046ab49015cf9cffca11597b9ee57d8a998bc.tar.gz
pdf-over-80f046ab49015cf9cffca11597b9ee57d8a998bc.tar.bz2
pdf-over-80f046ab49015cf9cffca11597b9ee57d8a998bc.zip
misc cleanup
Diffstat (limited to 'pdf-over-signer/src')
-rw-r--r--pdf-over-signer/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4BKUSLConnector.java21
-rw-r--r--pdf-over-signer/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4Helper.java3
-rw-r--r--pdf-over-signer/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4SignatureParameter.java7
3 files changed, 11 insertions, 20 deletions
diff --git a/pdf-over-signer/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4BKUSLConnector.java b/pdf-over-signer/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4BKUSLConnector.java
index 124bf43d..a78e33c6 100644
--- a/pdf-over-signer/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4BKUSLConnector.java
+++ b/pdf-over-signer/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4BKUSLConnector.java
@@ -46,8 +46,7 @@ public class PdfAs4BKUSLConnector extends BaseSLConnector {
/**
* SLF4J Logger instance
**/
- private static final Logger log = LoggerFactory
- .getLogger(PdfAs4BKUSLConnector.class);
+ private static final Logger log = LoggerFactory.getLogger(PdfAs4BKUSLConnector.class);
private BkuSlConnector connector;
@@ -70,13 +69,11 @@ public class PdfAs4BKUSLConnector extends BaseSLConnector {
JAXBElement<?> element = null;
try {
String slRequestString = SLMarschaller.marshalToString(this.of.createInfoboxReadRequest(request));
- //log.trace(slRequestString);
PdfAs4SLRequest slRequest = new PdfAs4SLRequest(slRequestString, null);
- String slResponse = this.connector.handleSLRequest(slRequest).getSLRespone();
+ String slResponse = this.connector.handleSLRequest(slRequest).getSLResponse();
- element = (JAXBElement<?>) SLMarschaller
- .unmarshalFromString(slResponse);
+ element = (JAXBElement<?>) SLMarschaller.unmarshalFromString(slResponse);
} catch (JAXBException e) {
throw new PDFIOException("error.pdf.io.03", e);
} catch (PdfAs4SLRequestException e) {
@@ -90,14 +87,10 @@ public class PdfAs4BKUSLConnector extends BaseSLConnector {
}
if (element.getValue() instanceof InfoboxReadResponseType) {
- InfoboxReadResponseType infoboxReadResponseType = (InfoboxReadResponseType) element
- .getValue();
- return infoboxReadResponseType;
+ return (InfoboxReadResponseType) element.getValue();
} else if (element.getValue() instanceof ErrorResponseType) {
- ErrorResponseType errorResponseType = (ErrorResponseType) element
- .getValue();
- throw new SLPdfAsException(errorResponseType.getErrorCode(),
- errorResponseType.getInfo());
+ ErrorResponseType errorResponseType = (ErrorResponseType)element.getValue();
+ throw new SLPdfAsException(errorResponseType.getErrorCode(), errorResponseType.getInfo());
}
throw new PdfAsException("error.pdf.io.03");
}
@@ -118,7 +111,7 @@ public class PdfAs4BKUSLConnector extends BaseSLConnector {
signatureData = PDFUtils.blackOutSignature(signatureData, pack.getByteRange());
PdfAs4SLRequest slRequest = new PdfAs4SLRequest(slRequestString, signatureData);
- String slResponse = this.connector.handleSLRequest(slRequest).getSLRespone();
+ String slResponse = this.connector.handleSLRequest(slRequest).getSLResponse();
element = (JAXBElement<?>) SLMarschaller
.unmarshalFromString(slResponse);
diff --git a/pdf-over-signer/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4Helper.java b/pdf-over-signer/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4Helper.java
index e0b8ff46..a41f2378 100644
--- a/pdf-over-signer/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4Helper.java
+++ b/pdf-over-signer/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4Helper.java
@@ -33,8 +33,7 @@ public class PdfAs4Helper {
* SLF4J Logger instance
**/
@SuppressWarnings("unused")
- private static final Logger log = LoggerFactory
- .getLogger(PdfAs4Helper.class);
+ private static final Logger log = LoggerFactory.getLogger(PdfAs4Helper.class);
/**
* PDF-AS Object
diff --git a/pdf-over-signer/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4SignatureParameter.java b/pdf-over-signer/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4SignatureParameter.java
index 032416cd..b54064ab 100644
--- a/pdf-over-signer/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4SignatureParameter.java
+++ b/pdf-over-signer/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4SignatureParameter.java
@@ -76,8 +76,7 @@ public class PdfAs4SignatureParameter extends SignatureParameter {
/**
* SLF4J Logger instance
**/
- static final Logger log = LoggerFactory
- .getLogger(PdfAs4SignatureParameter.class);
+ static final Logger log = LoggerFactory.getLogger(PdfAs4SignatureParameter.class);
private String profile = Profile.getDefaultProfile();
/* (non-Javadoc)
@@ -210,8 +209,8 @@ public class PdfAs4SignatureParameter extends SignatureParameter {
return profileId;
}
- private String getLangProfilePart(String lang) {
- return (lang != null && lang.equals("en")) ? PROFILE_ID_LANG_EN : PROFILE_ID_LANG_DE;
+ private static String getLangProfilePart(String lang) {
+ return ("en".equals(lang)) ? PROFILE_ID_LANG_EN : PROFILE_ID_LANG_DE;
}
@Override