From 3439ff611093d54368826b59515659f04c5788e3 Mon Sep 17 00:00:00 2001 From: CGantert345 <57003061+CGantert345@users.noreply.github.com> Date: Mon, 22 Nov 2021 16:20:23 +0100 Subject: bug fixes on dynamic frame - ExtensionMarker removed - default on format removed - keyId starting from 0 --- pom.xml | 2 +- src/main/java/org/uic/barcode/dynamicFrame/DataType.java | 2 -- src/main/java/org/uic/barcode/dynamicFrame/DynamicFrame.java | 6 +++--- src/main/java/org/uic/barcode/dynamicFrame/Level1DataType.java | 2 +- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/pom.xml b/pom.xml index 97460c1..5a4313c 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 org.uic.barcode org.uic.barcode - 1.2.7-SNAPSHOT + 1.2.8-SNAPSHOT jar UIC barcode encoding and decoding of bar code content according to UIC IRS 90918-9 diff --git a/src/main/java/org/uic/barcode/dynamicFrame/DataType.java b/src/main/java/org/uic/barcode/dynamicFrame/DataType.java index 2d6d984..2ea63ca 100644 --- a/src/main/java/org/uic/barcode/dynamicFrame/DataType.java +++ b/src/main/java/org/uic/barcode/dynamicFrame/DataType.java @@ -1,6 +1,5 @@ package org.uic.barcode.dynamicFrame; -import org.uic.barcode.asn1.datatypes.Asn1Default; import org.uic.barcode.asn1.datatypes.CharacterRestriction; import org.uic.barcode.asn1.datatypes.RestrictedString; import org.uic.barcode.asn1.datatypes.Sequence; @@ -20,7 +19,6 @@ public class DataType { * -- FCB2 FCB version 2 * -- RICS company code + ... **/ - @Asn1Default("FCB1") @RestrictedString(CharacterRestriction.IA5String) public String format; diff --git a/src/main/java/org/uic/barcode/dynamicFrame/DynamicFrame.java b/src/main/java/org/uic/barcode/dynamicFrame/DynamicFrame.java index 6cc1eaa..c74215d 100644 --- a/src/main/java/org/uic/barcode/dynamicFrame/DynamicFrame.java +++ b/src/main/java/org/uic/barcode/dynamicFrame/DynamicFrame.java @@ -14,7 +14,6 @@ import java.security.spec.X509EncodedKeySpec; import org.uic.barcode.asn1.datatypes.Asn1Optional; import org.uic.barcode.asn1.datatypes.CharacterRestriction; import org.uic.barcode.asn1.datatypes.FieldOrder; -import org.uic.barcode.asn1.datatypes.HasExtensionMarker; import org.uic.barcode.asn1.datatypes.RestrictedString; import org.uic.barcode.asn1.datatypes.Sequence; import org.uic.barcode.asn1.datatypesimpl.OctetString; @@ -29,7 +28,6 @@ import org.uic.barcode.utils.AlgorithmNameResolver; * Implementation of the Draft under discussion, not final. */ @Sequence -@HasExtensionMarker public class DynamicFrame extends Object{ public DynamicFrame() {} @@ -152,7 +150,9 @@ public class DynamicFrame extends Object{ byte[] keyBytes = this.getLevel2SignedData().getLevel1Data().level2publicKey.toByteArray(); X509EncodedKeySpec keySpec = new X509EncodedKeySpec(keyBytes); key = KeyFactory.getInstance(keyAlgName).generatePublic(keySpec); - } catch (InvalidKeySpecException | NoSuchAlgorithmException e1) { + } catch (InvalidKeySpecException e1) { + return Constants.LEVEL2_VALIDATION_KEY_ALG_NOT_IMPLEMENTED; + } catch (NoSuchAlgorithmException e1) { return Constants.LEVEL2_VALIDATION_KEY_ALG_NOT_IMPLEMENTED; } diff --git a/src/main/java/org/uic/barcode/dynamicFrame/Level1DataType.java b/src/main/java/org/uic/barcode/dynamicFrame/Level1DataType.java index aac0188..958cafc 100644 --- a/src/main/java/org/uic/barcode/dynamicFrame/Level1DataType.java +++ b/src/main/java/org/uic/barcode/dynamicFrame/Level1DataType.java @@ -34,7 +34,7 @@ public class Level1DataType { /** The key id. */ @FieldOrder(order = 2) - @IntRange(minValue=1,maxValue=99999) + @IntRange(minValue=0,maxValue=99999) @Asn1Optional public Long keyId; -- cgit v1.2.3