Example #1
0
        public byte[] ToEncodingMTA()
        {
            if (EncodedFile.Count() == 0)
            {
                return(null);
            }
            var      encodeStream      = new MemoryStream();
            var      binaryWriter      = new BinaryWriter(encodeStream);
            TLVUchar mtaDelimiterBegin = new TLVUchar("MtaConfigDelimiter", "1");

            binaryWriter.Write(EncodedFile.GetEncodings());
            //TODO: add Signature SNMP
            //SnmpMibObject  HexString calculate new Hesh Value
            TLVSnmp  signature       = new TLVSnmp("SnmpMibObject", "enterprises.7432.1.1.2.9.0 HexString 0x9b5cd26c31ae7818d23dd417553bd9c26768fe0f");
            TLVUchar mtaDelimiterEnd = new TLVUchar("MtaConfigDelimiter", "255");
            TLV      EndOfBataMkr    = new TLVSpecial();

            // Add EndOfDataMkr before making the MD5
            binaryWriter.Write(EndOfBataMkr.ToEncoding());
            return(encodeStream.ToArray());
        }
Example #2
0
        public byte[] ToEncoding()
        {
            if (EncodedFile.Count() == 0)
            {
                return(null);
            }
            var encodeStream = new MemoryStream();
            var binaryWriter = new BinaryWriter(encodeStream);

            binaryWriter.Write(EncodedFile.GetEncodings());
            TLV cmMIC = new TLVCMMIC(EncodedFile);

            binaryWriter.Write(cmMIC.ToEncoding());
            EncodedFile.Add(cmMIC);
            binaryWriter.Write((new TLVCMTSMIC(EncodedFile, Secret).ToEncoding()));
            TLV EndOfBataMkr = new TLVSpecial();

            // Add EndOfDataMkr before making the MD5
            binaryWriter.Write(EndOfBataMkr.ToEncoding());
            return(encodeStream.ToArray());
        }