Esempio n. 1
0
        /// <inheritdoc />
        public override void WriteData(PresentationWriter writer)
        {
            writer.WriteByte((byte)HashAlgorithm);
            writer.WriteByte((byte)Flags);
            writer.WriteUInt16(Iterations);

            if (Salt == null || Salt.Length == 0)
            {
                writer.WriteString("-");
            }
            else
            {
                writer.WriteBase16String(Salt);
            }

            writer.WriteString(Base32.ExtendedHex.Encode(NextHashedOwnerName, padding: false).ToLowerInvariant());

            bool next = false;

            foreach (var type in Types)
            {
                if (next)
                {
                    writer.WriteSpace();
                }
                writer.WriteDnsType(type, appendSpace: false);
                next = true;
            }
        }
Esempio n. 2
0
        public void WriteDomainName()
        {
            var text   = new StringWriter();
            var writer = new PresentationWriter(text);

            writer.WriteString("alpha.com");
            writer.WriteString("omega.com", appendSpace: false);
            Assert.AreEqual("alpha.com omega.com", text.ToString());

            text   = new StringWriter();
            writer = new PresentationWriter(text);
            writer.WriteDomainName(new DomainName("alpha.com"), false);
            Assert.AreEqual("alpha.com", text.ToString());
        }
Esempio n. 3
0
        public void WriteString()
        {
            var text   = new StringWriter();
            var writer = new PresentationWriter(text);

            writer.WriteString("alpha");
            writer.WriteString("a b");
            writer.WriteString(null);
            writer.WriteString("");
            writer.WriteString(" ");
            writer.WriteString("a\\b");
            writer.WriteString("a\"b");
            writer.WriteString("end", appendSpace: false);
            Assert.AreEqual("alpha \"a b\" \"\" \"\" \" \" a\\\\b a\\\"b end", text.ToString());
        }
Esempio n. 4
0
        /// <inheritdoc />
        public override void WriteData(PresentationWriter writer)
        {
            bool next = false;

            foreach (var s in Strings)
            {
                if (next)
                {
                    writer.WriteSpace();
                }
                writer.WriteString(s, appendSpace: false);
                next = true;
            }
        }
Esempio n. 5
0
        /// <inheritdoc />
        public override void WriteData(PresentationWriter writer)
        {
            writer.WriteByte((byte)HashAlgorithm);
            writer.WriteByte((byte)Flags);
            writer.WriteUInt16(Iterations);

            if (Salt == null || Salt.Length == 0)
            {
                writer.WriteString("-");
            }
            else
            {
                writer.WriteBase16String(Salt, appendSpace: false);
            }
        }
Esempio n. 6
0
 /// <inheritdoc />
 public override void WriteData(PresentationWriter writer)
 {
     writer.WriteString(Cpu);
     writer.WriteString(OS, appendSpace: false);
 }