aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at')
-rw-r--r--src/main/java/at/gv/egiz/pdfas/exceptions/ErrorCode.java2
-rw-r--r--src/main/java/at/gv/egiz/pdfas/impl/verificator/binary/BinaryVerificator_1_0_0.java4
2 files changed, 6 insertions, 0 deletions
diff --git a/src/main/java/at/gv/egiz/pdfas/exceptions/ErrorCode.java b/src/main/java/at/gv/egiz/pdfas/exceptions/ErrorCode.java
index d903c9b..857fc09 100644
--- a/src/main/java/at/gv/egiz/pdfas/exceptions/ErrorCode.java
+++ b/src/main/java/at/gv/egiz/pdfas/exceptions/ErrorCode.java
@@ -43,6 +43,8 @@ public final class ErrorCode
public static final int MODIFIED_AFTER_SIGNATION = 316;
public static final int NON_BINARY_SIGNATURES_PRESENT = 317;
+
+ public static final int UNSUPPORTED_REPLACES_NAME = 318;
public static final int SIGNATURE_VERIFICATION_NOT_SUPPORTED = 371;
public static final int INVALID_SIGNING_TIME = 372;
diff --git a/src/main/java/at/gv/egiz/pdfas/impl/verificator/binary/BinaryVerificator_1_0_0.java b/src/main/java/at/gv/egiz/pdfas/impl/verificator/binary/BinaryVerificator_1_0_0.java
index 9ca2246..46dbb40 100644
--- a/src/main/java/at/gv/egiz/pdfas/impl/verificator/binary/BinaryVerificator_1_0_0.java
+++ b/src/main/java/at/gv/egiz/pdfas/impl/verificator/binary/BinaryVerificator_1_0_0.java
@@ -309,6 +309,10 @@ public class BinaryVerificator_1_0_0 implements Verificator
ReplaceInfo ri = (ReplaceInfo) rit.next();
String type = SignatureTypes.convertBrevToType(ri.brev);
+
+ if (type == null) {
+ throw new PresentableException(ErrorCode.UNSUPPORTED_REPLACES_NAME, "Unsupported /replaces name.");
+ }
// signature_object.setSigValue(ri.type, ri.value);
if (type.equals(SignatureTypes.SIG_DATE))