package test.hxzon.asn1;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import org.hxzon.util.BytesUtil;
import com.chaosinmotion.asn1.BerInputStream;
import com.chaosinmotion.asn1.BerNode;
import com.chaosinmotion.asn1.TestParser;
public class Asn1Test {
//mms
// 0000 00 50 04 07 76 d6 00 0c 02 b0 89 3a 08 00 45 00 .P..v......:..E.
// 0010 00 9a 3d 63 00 00 40 06 db 58 ac 1e 04 02 ac 1e ..=c..@..X......
// 0020 05 64 00 66 05 6b 9c 41 29 05 dc 4f 5c b0 50 18 .d.f.k.A)..O\.P.
// 0030 39 08 6d 60 00 00 03 00 00 72 02 f0 80 01 00 01 9.m`.....r......
// 0040 00 61 65 30 63 02 01 03 a0 5e a3 5c a0 5a a1 05 .ae0c....^.\.Z..
// 0050 80 03 52 50 54 a0 51 8a 19 46 37 31 34 4c 44 30 ..RPT.Q..F714LD0
// 0060 2f 4c 4c 4e 30 24 72 63 62 4d 65 61 73 46 6c 74 /LLN0$rcbMeasFlt
// 0070 30 31 84 03 06 51 00 86 01 71 89 08 00 06 10 ae 01...Q...q......
// 0080 00 00 00 00 84 09 04 00 00 00 00 00 00 14 00 87 ................
// 0090 05 08 40 be 66 66 91 08 47 c2 7c 6e 17 4f c3 0a ..@.ff..G.|n.O..
// 00a0 84 02 02 40 84 02 02 40 ...@...@
static String s1="a3 5c a0 5a a1 05"//
+"80 03 52 50 54 a0 51 8a 19 46 37 31 34 4c 44 30"
+"2f 4c 4c 4e 30 24 72 63 62 4d 65 61 73 46 6c 74"
+"30 31 84 03 06 51 00 86 01 71 89 08 00 06 10 ae"
+"00 00 00 00 84 09 04 00 00 00 00 00 00 14 00 87"
+"05 08 40 be 66 66 91 08 47 c2 7c 6e 17 4f c3 0a"
+"84 02 02 40 84 02 02 40 ";
//9-1
// 0000 01 0c cd 04 00 11 00 e0 4c 00 00 00 88 ba 40 00 ........L.....@.
// 0010 00 3a 00 4f 00 4f 80 30 00 01 00 2c 02 fe 00 00 .:.O.O.0...,....
// 0020 00 00 00 00 00 00 00 00 ff fe ff fc ff ff ff ff ................
// 0030 ff fe 00 00 ff ff ff f9 ff fb ff fa ff ff ff fe ................
// 0040 00 10 00 00 ec 09 60 01 ......`.
static String s2="40 00"
+"00 3a 00 4f 00 4f 80 30 00 01 00 2c 02 fe 00 00"
+"00 00 00 00 00 00 00 00 ff fe ff fc ff ff ff ff"
+"ff fe 00 00 ff ff ff f9 ff fb ff fa ff ff ff fe"
+"00 10 00 00 ec 09 60 01 ";
//goose
// 0000 01 0c cd 01 00 12 00 00 23 06 04 38 81 00 80 01 ........#..8....
// 0010 88 b8 00 12 01 01 00 00 00 00 61 81 f6 80 22 52 ..........a..."R
// 0020 45 43 36 37 30 5f 42 5a 54 31 4c 44 30 2f 4c 4c EC670_BZT1LD0/LL
// 0030 4e 30 24 47 4f 24 47 53 45 43 6f 6e 74 72 6f 6c N0$GO$GSEControl
// 0040 31 81 02 15 7c 82 1a 52 45 43 36 37 30 5f 42 5a 1...|..REC670_BZ
// 0050 54 31 4c 44 30 2f 4c 4c 4e 30 24 47 4f 4f 53 45 T1LD0/LLN0$GOOSE
// 0060 31 83 0f 52 45 43 36 37 30 5f 42 5a 54 31 5f 54 1..REC670_BZT1_T
// 0070 58 31 84 08 49 d9 57 2c 9e 76 c9 6a 85 01 41 86 X1..I.W,.v.j..A.
// 0080 03 04 f1 2f 87 01 00 88 01 01 89 01 00 8a 01 20 .../...........
// 0090 ab 81 80 83 01 00 84 03 03 00 00 83 01 00 84 03 ................
// 00a0 03 00 00 83 01 00 84 03 03 00 00 83 01 00 84 03 ................
// 00b0 03 00 00 83 01 00 84 03 03 00 00 83 01 00 84 03 ................
// 00c0 03 00 00 83 01 00 84 03 03 00 00 83 01 00 84 03 ................
// 00d0 03 00 00 83 01 00 84 03 03 00 00 83 01 00 84 03 ................
// 00e0 03 00 00 83 01 00 84 03 03 00 00 83 01 00 84 03 ................
// 00f0 03 00 00 83 01 00 84 03 03 00 00 83 01 00 84 03 ................
// 0100 03 00 00 83 01 00 84 03 03 00 00 83 01 00 84 03 ................
// 0110 03 00 00 ...
public static String s3="80 22 52"//61 81 f6
+"45 43 36 37 30 5f 42 5a 54 31 4c 44 30 2f 4c 4c"
+"4e 30 24 47 4f 24 47 53 45 43 6f 6e 74 72 6f 6c"
+"31 81 02 15 7c 82 1a 52 45 43 36 37 30 5f 42 5a"
+"54 31 4c 44 30 2f 4c 4c 4e 30 24 47 4f 4f 53 45"
+"31 83 0f 52 45 43 36 37 30 5f 42 5a 54 31 5f 54"
+"58 31 84 08 49 d9 57 2c 9e 76 c9 6a 85 01 41 86"
+"03 04 f1 2f 87 01 00 88 01 01 89 01 00 8a 01 20"
+"ab 81 80 83 01 00 84 03 03 00 00 83 01 00 84 03"
+"03 00 00 83 01 00 84 03 03 00 00 83 01 00 84 03"
+"03 00 00 83 01 00 84 03 03 00 00 83 01 00 84 03"
+"03 00 00 83 01 00 84 03 03 00 00 83 01 00 84 03"
+"03 00 00 83 01 00 84 03 03 00 00 83 01 00 84 03"
+"03 00 00 83 01 00 84 03 03 00 00 83 01 00 84 03"
+"03 00 00 83 01 00 84 03 03 00 00 83 01 00 84 03"
+"03 00 00 83 01 00 84 03 03 00 00 83 01 00 84 03"
+"03 00 00 ";
public static void main(String[] args) throws IOException {
byte[] data=BytesUtil.fromHexString(s3);
// String reverse=BytesUtils.bytesToHexString(data);
// System.out.println(reverse);
ByteArrayInputStream inStream = new ByteArrayInputStream(data);
BerInputStream in = new BerInputStream(inStream);
TestParser parser = new TestParser();
BerNode node;
while (null != (node = parser.readPacket(in))) {
System.out.println(node.toString());
}
}
}