Ejemplo 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");



            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");
            }
        }
Ejemplo n.º 2
0
        public static void 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 };
            Asn1Data asn1Reader = Asn1ReaderT.ParseFromRawData(dataBytes);

            Asn1Logger.LogCurrentNodeValues(asn1Reader, "Validity");

            bool isMovedNext = Asn1ReaderT.MoveNext(asn1Reader);

            if (isMovedNext)
            {
                Asn1Logger.LogCurrentNodeValues(asn1Reader, "StartDate");
                isMovedNext = Asn1ReaderT.MoveNext(asn1Reader);
                if (isMovedNext)
                {
                    Asn1Logger.LogCurrentNodeValues(asn1Reader, "EndDate");
                }
                else
                {
                    Logger.writeLog("ERROR-Can not move to EndDate");
                }
            }
            else
            {
                Logger.writeLog("ERROR-Can not move to StartDate");
            }
        }
Ejemplo n.º 3
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");
            Asn1ReaderT.LogCurrentNodeValues(asn1Reader, "Validity");

            bool isMovedNext = Asn1ReaderT.MoveNext(asn1Reader);

            if (isMovedNext)
            {
                Logger.writeLog("Moved to StartDate");
                Asn1ReaderT.LogCurrentNodeValues(asn1Reader, "StartDate");
                isMovedNext = Asn1ReaderT.MoveNext(asn1Reader);
                if (isMovedNext)
                {
                    Logger.writeLog("Moved to EndDate");
                    Asn1ReaderT.LogCurrentNodeValues(asn1Reader, "EndDate");
                }
                else
                {
                    Logger.writeLog("Can not move to EndDate");
                }
            }
            else
            {
                Logger.writeLog("Can not move to StartDate");
            }
        }
Ejemplo 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");

            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);

            Storage.Put(Storage.CurrentContext, "isMovedNext", isMovedNext.ToString());
        }