aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-lib/src/main/java/at/gv/egiz/sl
diff options
context:
space:
mode:
authorAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2013-12-12 13:31:47 +0100
committerAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2013-12-12 13:31:47 +0100
commita465414ecb2bc2792bb56a17d5ae4e883d8c3a88 (patch)
treea445844289f1f5e815e1c517a3302c9f0912291a /pdf-as-lib/src/main/java/at/gv/egiz/sl
parent863f99753af19b3f5ce354d4d1ff0a5e8a4f32dd (diff)
downloadpdf-as-4-a465414ecb2bc2792bb56a17d5ae4e883d8c3a88.tar.gz
pdf-as-4-a465414ecb2bc2792bb56a17d5ae4e883d8c3a88.tar.bz2
pdf-as-4-a465414ecb2bc2792bb56a17d5ae4e883d8c3a88.zip
Moved harded messages to common.properties
Diffstat (limited to 'pdf-as-lib/src/main/java/at/gv/egiz/sl')
-rw-r--r--pdf-as-lib/src/main/java/at/gv/egiz/sl/util/BKUSLConnector.java20
-rw-r--r--pdf-as-lib/src/main/java/at/gv/egiz/sl/util/BaseSLConnector.java5
-rw-r--r--pdf-as-lib/src/main/java/at/gv/egiz/sl/util/ISignatureConnectorSLWrapper.java6
3 files changed, 14 insertions, 17 deletions
diff --git a/pdf-as-lib/src/main/java/at/gv/egiz/sl/util/BKUSLConnector.java b/pdf-as-lib/src/main/java/at/gv/egiz/sl/util/BKUSLConnector.java
index 414f2854..3820df8f 100644
--- a/pdf-as-lib/src/main/java/at/gv/egiz/sl/util/BKUSLConnector.java
+++ b/pdf-as-lib/src/main/java/at/gv/egiz/sl/util/BKUSLConnector.java
@@ -99,15 +99,15 @@ public class BKUSLConnector extends BaseSLConnector {
.unmarshalFromString(slResponse);
} catch (JAXBException e) {
- throw new PDFIOException("SL_COM", e);
+ throw new PDFIOException("error.pdf.io.03", e);
} catch (ClientProtocolException e) {
- throw new PDFIOException("SL_COM", e);
+ throw new PDFIOException("error.pdf.io.03", e);
} catch (IOException e) {
- throw new PDFIOException("SL_COM", e);
+ throw new PDFIOException("error.pdf.io.03", e);
}
if (element == null) {
- throw new PDFIOException("SL ELEMENT NOT AVAILABLE");
+ throw new PDFIOException("error.pdf.io.04");
}
if (element.getValue() instanceof InfoboxReadResponseType) {
@@ -120,7 +120,7 @@ public class BKUSLConnector extends BaseSLConnector {
throw new SLPdfAsException(errorResponseType.getErrorCode(),
errorResponseType.getInfo());
}
- throw new PdfAsException("Invalid SL Repsonse");
+ throw new PdfAsException("error.pdf.io.03");
}
public CreateCMSSignatureResponseType sendCMSRequest(
@@ -137,15 +137,15 @@ public class BKUSLConnector extends BaseSLConnector {
element = (JAXBElement) SLMarschaller
.unmarshalFromString(slResponse);
} catch (JAXBException e) {
- throw new PDFIOException("SL_COM", e);
+ throw new PDFIOException("error.pdf.io.03", e);
} catch (ClientProtocolException e) {
- throw new PDFIOException("SL_COM", e);
+ throw new PDFIOException("error.pdf.io.03", e);
} catch (IOException e) {
- throw new PDFIOException("SL_COM", e);
+ throw new PDFIOException("error.pdf.io.03", e);
}
if (element == null) {
- throw new PDFIOException("SL ELEMENT NOT AVAILABLE");
+ throw new PDFIOException("error.pdf.io.05");
}
if (element.getValue() instanceof CreateCMSSignatureResponseType) {
@@ -159,7 +159,7 @@ public class BKUSLConnector extends BaseSLConnector {
throw new SLPdfAsException(errorResponseType.getErrorCode(),
errorResponseType.getInfo());
}
- throw new PdfAsException("Invalid SL Repsonse");
+ throw new PdfAsException("error.pdf.io.03");
}
}
diff --git a/pdf-as-lib/src/main/java/at/gv/egiz/sl/util/BaseSLConnector.java b/pdf-as-lib/src/main/java/at/gv/egiz/sl/util/BaseSLConnector.java
index c32a4c32..b02e4f1a 100644
--- a/pdf-as-lib/src/main/java/at/gv/egiz/sl/util/BaseSLConnector.java
+++ b/pdf-as-lib/src/main/java/at/gv/egiz/sl/util/BaseSLConnector.java
@@ -1,13 +1,11 @@
package at.gv.egiz.sl.util;
import java.math.BigInteger;
-import java.security.MessageDigest;
import java.util.Arrays;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import at.gv.egiz.pdfas.common.utils.StringUtils;
import at.gv.egiz.sl.Base64OptRefContentType;
import at.gv.egiz.sl.CMSDataObjectRequiredMetaType;
import at.gv.egiz.sl.CreateCMSSignatureRequestType;
@@ -25,7 +23,7 @@ public abstract class BaseSLConnector implements ISLConnector {
public static final String SecureSignatureKeypair = "SecureSignatureKeypair";
public static final String PDF_MIME_TYPE = "application/pdf";
- public static final String PDF_MIME_TYPE_DESC = "Adobe PDF-Dateien";
+ public static final String PDF_MIME_TYPE_DESC = "Adobe PDF-File";
public static final String DETACHED = "detached";
@@ -80,7 +78,6 @@ public abstract class BaseSLConnector implements ISLConnector {
// == MetaInfoType
MetaInfoType metaInfoType = new MetaInfoType();
metaInfoType.setMimeType(PDF_MIME_TYPE);
- metaInfoType.setDescription(PDF_MIME_TYPE_DESC);
// == Base64OptRefContentType
Base64OptRefContentType base64OptRefContentType = new Base64OptRefContentType();
diff --git a/pdf-as-lib/src/main/java/at/gv/egiz/sl/util/ISignatureConnectorSLWrapper.java b/pdf-as-lib/src/main/java/at/gv/egiz/sl/util/ISignatureConnectorSLWrapper.java
index 409b984f..273f08ab 100644
--- a/pdf-as-lib/src/main/java/at/gv/egiz/sl/util/ISignatureConnectorSLWrapper.java
+++ b/pdf-as-lib/src/main/java/at/gv/egiz/sl/util/ISignatureConnectorSLWrapper.java
@@ -104,13 +104,13 @@ public class ISignatureConnectorSLWrapper implements ISignatureConnector {
verifyResult.setSignerCertificate(signedData
.getCertificate(signerInfos[i]
.getSignerIdentifier()));
- throw new PdfAsSignatureException("Invalid Signature", ex);
+ throw new PdfAsSignatureException("error.pdf.sig.08", ex);
}
}
} catch (CMSException e) {
- throw new PdfAsSignatureException("Invalid Signature", e);
+ throw new PdfAsSignatureException("error.pdf.sig.08", e);
} catch (IOException e) {
- throw new PdfAsSignatureException("Invalid Signature", e);
+ throw new PdfAsSignatureException("error.pdf.sig.08", e);
}
return response.getCMSSignature();