summaryrefslogtreecommitdiffstats
path: root/src/org/uic/barcode/test/SignatureSplitTest.java
diff options
context:
space:
mode:
authorCGantert345 <57003061+CGantert345@users.noreply.github.com>2021-03-29 14:08:45 +0200
committerCGantert345 <57003061+CGantert345@users.noreply.github.com>2021-03-29 14:08:45 +0200
commite023e674020f1a435f7b8c8b9276704f576ea6e5 (patch)
tree011863c021df3e5356f07b056d30d0e7476061e4 /src/org/uic/barcode/test/SignatureSplitTest.java
parentMerge pull request #13 from UnionInternationalCheminsdeFer/time_zone_fix_3 (diff)
downloadUIC-barcode-e023e674020f1a435f7b8c8b9276704f576ea6e5.tar
UIC-barcode-e023e674020f1a435f7b8c8b9276704f576ea6e5.tar.gz
UIC-barcode-e023e674020f1a435f7b8c8b9276704f576ea6e5.tar.bz2
UIC-barcode-e023e674020f1a435f7b8c8b9276704f576ea6e5.tar.lz
UIC-barcode-e023e674020f1a435f7b8c8b9276704f576ea6e5.tar.xz
UIC-barcode-e023e674020f1a435f7b8c8b9276704f576ea6e5.tar.zst
UIC-barcode-e023e674020f1a435f7b8c8b9276704f576ea6e5.zip
Diffstat (limited to 'src/org/uic/barcode/test/SignatureSplitTest.java')
-rw-r--r--src/org/uic/barcode/test/SignatureSplitTest.java76
1 files changed, 0 insertions, 76 deletions
diff --git a/src/org/uic/barcode/test/SignatureSplitTest.java b/src/org/uic/barcode/test/SignatureSplitTest.java
deleted file mode 100644
index 08fe3ad..0000000
--- a/src/org/uic/barcode/test/SignatureSplitTest.java
+++ /dev/null
@@ -1,76 +0,0 @@
-package org.uic.barcode.test;
-
-import static org.junit.Assert.assertEquals;
-
-import java.io.IOException;
-import java.math.BigInteger;
-
-import org.junit.Test;
-import org.uic.barcode.staticFrame.StaticFrame;
-import org.uic.barcode.test.utils.TestUtils;
-import org.uic.barcode.ticket.EncodingFormatException;
-
-public class SignatureSplitTest {
-
-
- /*
- *
- *
- * World-Schema DEFINITIONS AUTOMATIC TAGS ::=
- BEGIN
- Signature ::= SEQUENCE OF INTEGER
- END
-
-
- value Signature ::= {
- 340282366920938463,
- 134515671861986
- }
-
-
- Encoding using DER encoding rule
- Signature SEQUENCE OF: tag = [UNIVERSAL 16] constructed; length = 18
- INTEGER: tag = [UNIVERSAL 2] primitive; length = 8
- 340282366920938463
- INTEGER: tag = [UNIVERSAL 2] primitive; length = 6
- 134515671861986
- Encoded successfully in 20 bytes: 30120208 04B8ED02 83A6D3DF 02067A57 5ED68AE2
-
-
- *
- *
- */
-
-
- @Test public void testSplitSignature() throws IOException, EncodingFormatException{
-
- BigInteger i1 = BigInteger.valueOf(340282366920938463L);
- BigInteger i2 = BigInteger.valueOf(134515671861986L);
-
- byte[] encoded = StaticFrame.encodeSignatureIntegerSequence(i1,i2);
-
-
- String hex = TestUtils.hexStringFromBytes(encoded);
-
- assertEquals(hex,"3012020804B8ED0283A6D3DF02067A575ED68AE2");
-
- BigInteger[] ints = null;
- try {
- ints = StaticFrame.decodeSignatureIntegerSequence(encoded);
- } catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
-
- assert(ints != null);
-
- assert(ints.length == 2);
-
- assert(i1.equals(ints[0]));
-
- assert(i2.equals(ints[1]));
-
- }
-
-
-} \ No newline at end of file