Esempio n. 1
0
        public static void Main()
        {
            Logger.writeLog("Starting Smart Contract Main -->");
            byte[] dataBytes = new byte[] { 0x30, 0x1E, 0x17, 0x0D, 0x31, 0x32, 0x30, 0x34, 0x32, 0x37, 0x31, 0x30, 0x33, 0x31, 0x31, 0x38, 0x5A, 0x17, 0x0D, 0x32, 0x32, 0x30, 0x34, 0x32, 0x35, 0x31, 0x30, 0x33, 0x31, 0x31, 0x38, 0x5A };
            Logger.writeLog("Constructing asn1Reader class");
            Asn1Reader asn1Reader = Asn1ReaderT.FromRawData(dataBytes);

            Logger.writeLog("Constructed asn1Reader class");

            Logger.writeLog("Getting Header");
            byte[] headerBytes = Asn1ReaderT.GetHeader(asn1Reader);
            Logger.writeLog("Retrieved Header");

            Logger.writeLog("Getting Payload");
            byte[] payloadBytes = Asn1ReaderT.GetPayload(asn1Reader);
            Logger.writeLog("Retrieved Payload");

            Logger.writeLog("Getting TagRawData");
            byte[] tagRawDataBytes = Asn1ReaderT.GetPayload(asn1Reader);
            Logger.writeLog("Retrieved TagRawData");

            Storage.Put(Storage.CurrentContext, "dataBytes", dataBytes);
            Storage.Put(Storage.CurrentContext, "Header", headerBytes);
            Storage.Put(Storage.CurrentContext, "Payload", payloadBytes);
            Storage.Put(Storage.CurrentContext, "TagRawData", tagRawDataBytes);

            int nestedNodeCount = Asn1ReaderT.GetNestedNodeCount(asn1Reader);

            Storage.Put(Storage.CurrentContext, "nestedNodeCount", nestedNodeCount);

            bool isMovedNext = Asn1ReaderT.MoveNext(asn1Reader);

            if (isMovedNext)
            {
                Logger.writeLog("Moved Next on asn1Reader");
            }
            else
            {
                Logger.writeLog("Can not move next on asn1Reader");
            }
        }
Esempio n. 2
0
        public static void Main()
        {
            Logger.writeLog("Start - Main() method");
            byte[]     dataBytes  = new byte[] { 0x30, 0x1E, 0x17, 0x0D, 0x31, 0x32, 0x30, 0x34, 0x32, 0x37, 0x31, 0x30, 0x33, 0x31, 0x31, 0x38, 0x5A, 0x17, 0x0D, 0x32, 0x32, 0x30, 0x34, 0x32, 0x35, 0x31, 0x30, 0x33, 0x31, 0x31, 0x38, 0x5A };
            Asn1Reader asn1Reader = Asn1ReaderT.FromRawData(dataBytes);

            byte[] headerBytes     = Asn1ReaderT.GetHeader(asn1Reader);
            byte[] payloadBytes    = Asn1ReaderT.GetPayload(asn1Reader);
            byte[] tagRawDataBytes = Asn1ReaderT.GetPayload(asn1Reader);

            Storage.Put(Storage.CurrentContext, "dataBytes", dataBytes);
            Storage.Put(Storage.CurrentContext, "Header", headerBytes);
            Storage.Put(Storage.CurrentContext, "Payload", payloadBytes);
            Storage.Put(Storage.CurrentContext, "TagRawData", tagRawDataBytes);
            Logger.writeLog("End - Main() method");

            int nestedNodeCount = Asn1Reader.GetNestedNodeCount(asn1Reader);

            Storage.Put(Storage.CurrentContext, "nestedNodeCount", nestedNodeCount);
            // return dataBytes;AsnInternalMap
        }
Esempio n. 3
0
        public static void Main()
        {
            Logger.writeLog("Starting Smart Contract Main");
            // byte[] dataBytes = null;// new byte[] { 0x30, 0x1E, 0x17, 0x0D, 0x31, 0x32, 0x30, 0x34, 0x32, 0x37, 0x31, 0x30, 0x33, 0x31, 0x31, 0x38, 0x5A, 0x17, 0x0D, 0x32, 0x32, 0x30, 0x34, 0x32, 0x35, 0x31, 0x30, 0x33, 0x31, 0x31, 0x38, 0x5A };
            Logger.writeLog("Constructing asn1Reader class");
            byte[]     dataBytes  = null;
            Asn1Reader asn1Reader = Asn1ReaderT.FromRawData(dataBytes);

            Logger.writeLog("Constructed asn1Reader class");

            Logger.writeLog("Getting Header");
            byte[] headerBytes = Asn1ReaderT.GetHeader(asn1Reader);
            Logger.writeLog("Retrieved Header");

            Logger.writeLog("Getting Payload");
            byte[] payloadBytes = Asn1ReaderT.GetPayload(asn1Reader);
            Logger.writeLog("Retrieved Payload");

            Logger.writeLog("Getting TagRawData");
            byte[] tagRawDataBytes = Asn1ReaderT.GetPayload(asn1Reader);
            Logger.writeLog("Retrieved TagRawData");

            Storage.Put(Storage.CurrentContext, "dataBytes", dataBytes);
            Storage.Put(Storage.CurrentContext, "Header", headerBytes);
            Storage.Put(Storage.CurrentContext, "Payload", payloadBytes);
            Storage.Put(Storage.CurrentContext, "TagRawData", tagRawDataBytes);


            /*
             * int nestedNodeCount  = Asn1Reader.GetNestedNodeCount(asn1Reader);
             * Logger.writeLog("7");
             *
             * Storage.Put(Storage.CurrentContext, "nestedNodeCount", nestedNodeCount);
             * Logger.writeLog("8");
             */

            // return dataBytes;AsnInternalMap
        }
Esempio n. 4
0
        public static void Main()
        {
            Logger.writeLog("Starting Smart Contract Main -->");
            byte[] dataBytes = new byte[] { 0x30, 0x1E, 0x17, 0x0D, 0x31, 0x32, 0x30, 0x34, 0x32, 0x37, 0x31, 0x30, 0x33, 0x31, 0x31, 0x38, 0x5A, 0x17, 0x0D, 0x32, 0x32, 0x30, 0x34, 0x32, 0x35, 0x31, 0x30, 0x33, 0x31, 0x31, 0x38, 0x5A };
            Logger.writeLog("Constructing asn1Reader class");
            Asn1Reader asn1Reader = Asn1ReaderT.FromRawData(dataBytes);

            Logger.writeLog("Constructed asn1Reader class");
            LogCurrentNodeValues(asn1Reader, "Validity");



            bool isMovedNext = Asn1ReaderT.MoveNext(asn1Reader);

            if (isMovedNext)
            {
                Logger.writeLog("Moved Next on asn1Reader");
            }
            else
            {
                Logger.writeLog("Can not move next on asn1Reader");
            }
        }