Ejemplo 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;
            }
        }
Ejemplo 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());
        }
Ejemplo 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());
        }
Ejemplo 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;
            }
        }
Ejemplo 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);
            }
        }
Ejemplo n.º 6
0
 /// <inheritdoc />
 public override void WriteData(PresentationWriter writer)
 {
     writer.WriteString(Cpu);
     writer.WriteString(OS, appendSpace: false);
 }