diff options
author | CGantert345 <57003061+CGantert345@users.noreply.github.com> | 2023-03-09 16:30:19 +0100 |
---|---|---|
committer | CGantert345 <57003061+CGantert345@users.noreply.github.com> | 2023-03-09 16:30:19 +0100 |
commit | 37ddd3d075d0664de44f05639712869596bfb9cd (patch) | |
tree | 5d22d5578e550a0b3435c78fe133545026dffabe /src/main/java/org/uic/barcode/Encoder.java | |
parent | error messages for wrong header content (diff) | |
download | UIC-barcode-37ddd3d075d0664de44f05639712869596bfb9cd.tar UIC-barcode-37ddd3d075d0664de44f05639712869596bfb9cd.tar.gz UIC-barcode-37ddd3d075d0664de44f05639712869596bfb9cd.tar.bz2 UIC-barcode-37ddd3d075d0664de44f05639712869596bfb9cd.tar.lz UIC-barcode-37ddd3d075d0664de44f05639712869596bfb9cd.tar.xz UIC-barcode-37ddd3d075d0664de44f05639712869596bfb9cd.tar.zst UIC-barcode-37ddd3d075d0664de44f05639712869596bfb9cd.zip |
Diffstat (limited to 'src/main/java/org/uic/barcode/Encoder.java')
-rw-r--r-- | src/main/java/org/uic/barcode/Encoder.java | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/main/java/org/uic/barcode/Encoder.java b/src/main/java/org/uic/barcode/Encoder.java index b01ca14..cf2d4d2 100644 --- a/src/main/java/org/uic/barcode/Encoder.java +++ b/src/main/java/org/uic/barcode/Encoder.java @@ -19,6 +19,7 @@ import org.uic.barcode.dynamicFrame.api.SimpleLevel1Data; import org.uic.barcode.dynamicFrame.api.SimpleLevel2Data;
import org.uic.barcode.dynamicFrame.v1.DynamicFrameCoderV1;
import org.uic.barcode.dynamicFrame.v2.DynamicFrameCoderV2;
+import org.uic.barcode.ssbFrame.SsbFrame;
import org.uic.barcode.staticFrame.StaticFrame;
import org.uic.barcode.staticFrame.UFLEXDataRecord;
import org.uic.barcode.staticFrame.UHEADDataRecord;
@@ -45,6 +46,9 @@ public class Encoder { /** The static frame. */
private StaticFrame staticFrame = null;
+ /** The ssb frame. */
+ private SsbFrame ssbFrame = null;
+
/** The UIC bar code type classic. */
public static String UIC_BARCODE_TYPE_CLASSIC = "UIC_CLASSIC";
@@ -52,6 +56,9 @@ public class Encoder { /** The UIC bar code type DOSIPAS. */
public static String UIC_BARCODE_TYPE_DOSIPAS = "UIC_DOSIPAS";
+ /** The UIC bar code type SSB. */
+ public static String UIC_BARCODE_TYPE_SSB = "UIC_SSB";
+
/**
* Instantiates a new encoder.
*
@@ -119,6 +126,11 @@ public class Encoder { dynamicFrame.getLevel2Data().getLevel1Data().addData(ticketData);
}
+
+ } else if (barcodeType == UIC_BARCODE_TYPE_SSB) {
+
+ ssbFrame = new SsbFrame();
+
}
}
@@ -369,6 +381,8 @@ public class Encoder { staticFrame.getHeaderRecord().setIssuer(securityProvider);
}
staticFrame.signByAlgorithmOID(key,signingAlg);
+ } else if (ssbFrame != null) {
+ ssbFrame.signLevel1(key, null, keyId, signingAlg);
}
}
@@ -395,6 +409,8 @@ public class Encoder { staticFrame.getHeaderRecord().setIssuer(securityProvider);
}
staticFrame.signByAlgorithmOID(key,signingAlg,prov);
+ } else if (ssbFrame != null) {
+ ssbFrame.signLevel1(key, prov, keyId, signingAlg);
}
}
@@ -461,6 +477,14 @@ public class Encoder { }
}
+ public SsbFrame getSsbFrame() {
+ return ssbFrame;
+ }
+
+ public void setSsbFrame(SsbFrame ssbFrame) {
+ this.ssbFrame = ssbFrame;
+ }
+
|