diff options
author | CGantert345 <57003061+CGantert345@users.noreply.github.com> | 2023-03-14 10:31:01 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-14 10:31:01 +0100 |
commit | 4d2d3658c70347e9cffa049898b2b768bafe6174 (patch) | |
tree | 2b41ba728d15dace11d75a7d8b62976b69fcb379 /src/main/java/org/uic/barcode/Encoder.java | |
parent | check for inflater return code added (diff) | |
parent | update version number (diff) | |
download | UIC-barcode-1.4.0.tar UIC-barcode-1.4.0.tar.gz UIC-barcode-1.4.0.tar.bz2 UIC-barcode-1.4.0.tar.lz UIC-barcode-1.4.0.tar.xz UIC-barcode-1.4.0.tar.zst UIC-barcode-1.4.0.zip |
Diffstat (limited to 'src/main/java/org/uic/barcode/Encoder.java')
-rw-r--r-- | src/main/java/org/uic/barcode/Encoder.java | 26 |
1 files changed, 26 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..f2b9b0c 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);
}
}
@@ -446,6 +462,8 @@ public class Encoder { return DynamicFrameCoder.encode(dynamicFrame);
} else if (staticFrame != null) {
return staticFrame.encode();
+ } else if (ssbFrame != null) {
+ return ssbFrame.encode();
}
return null;
}
@@ -461,6 +479,14 @@ public class Encoder { }
}
+ public SsbFrame getSsbFrame() {
+ return ssbFrame;
+ }
+
+ public void setSsbFrame(SsbFrame ssbFrame) {
+ this.ssbFrame = ssbFrame;
+ }
+
|