Esempio n. 1
0
 /// <inheritdoc />
 public override void WriteData(PresentationWriter writer)
 {
     writer.WriteUInt16(Priority);
     writer.WriteUInt16(Weight);
     writer.WriteUInt16(Port);
     writer.WriteDomainName(Target, appendSpace: false);
 }
Esempio n. 2
0
        public void WriteUInt16()
        {
            var text   = new StringWriter();
            var writer = new PresentationWriter(text);

            writer.WriteUInt16(ushort.MaxValue);
            writer.WriteUInt16(1, appendSpace: false);
            Assert.AreEqual("65535 1", text.ToString());
        }
Esempio n. 3
0
 /// <inheritdoc />
 public override void WriteData(PresentationWriter writer)
 {
     writer.WriteDomainName(Algorithm);
     writer.WriteDateTime(Inception);
     writer.WriteDateTime(Expiration);
     writer.WriteUInt16((ushort)Mode);
     writer.WriteUInt16((ushort)Error);
     writer.WriteBase64String(Key);
     writer.WriteBase64String(OtherData ?? NoData, appendSpace: false);
 }
Esempio n. 4
0
 /// <inheritdoc />
 public override void WriteData(PresentationWriter writer)
 {
     writer.WriteDomainName(Algorithm);
     writer.WriteDateTime(TimeSigned);
     writer.WriteTimeSpan16(Fudge);
     writer.WriteBase64String(MAC);
     writer.WriteUInt16(OriginalMessageId);
     writer.WriteUInt16((ushort)Error);
     writer.WriteBase64String(OtherData ?? NoData, appendSpace: false);
 }
Esempio n. 5
0
 /// <inheritdoc />
 public override void WriteData(PresentationWriter writer)
 {
     writer.WriteUInt16((ushort)Flags);
     writer.WriteByte(Protocol);
     writer.WriteByte((byte)Algorithm);
     writer.WriteBase64String(PublicKey, appendSpace: false);
 }
Esempio n. 6
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. 7
0
 /// <inheritdoc />
 public override void WriteData(PresentationWriter writer)
 {
     writer.WriteUInt16(KeyTag);
     writer.WriteByte((byte)Algorithm);
     writer.WriteByte((byte)HashAlgorithm);
     writer.WriteBase16String(Digest, appendSpace: false);
 }
Esempio n. 8
0
 /// <inheritdoc />
 public override void WriteData(PresentationWriter writer)
 {
     writer.WriteDnsType(TypeCovered);
     writer.WriteByte((byte)Algorithm);
     writer.WriteByte(Labels);
     writer.WriteTimeSpan32(OriginalTTL);
     writer.WriteDateTime(SignatureExpiration);
     writer.WriteDateTime(SignatureInception);
     writer.WriteUInt16(KeyTag);
     writer.WriteDomainName(SignerName);
     writer.WriteBase64String(Signature, appendSpace: false);
 }
Esempio n. 9
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. 10
0
 /// <inheritdoc />
 public override void WriteData(PresentationWriter writer)
 {
     writer.WriteUInt16(Preference);
     writer.WriteDomainName(Exchange, appendSpace: false);
 }
Esempio n. 11
0
 /// <inheritdoc />
 public override void WriteData(PresentationWriter writer)
 {
     writer.WriteUInt16(Subtype);
     writer.WriteDomainName(Target, appendSpace: false);
 }