public void WriteDnsType() { var text = new StringWriter(); var writer = new PresentationWriter(text); writer.WriteDnsType(DnsType.ANY); writer.WriteDnsType((DnsType)1234, appendSpace: false); Assert.AreEqual("ANY TYPE1234", text.ToString()); }
/// <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; } }
/// <inheritdoc /> public override string ToString() { using (var s = new StringWriter()) { var writer = new PresentationWriter(s); writer.WriteDomainName(Name); writer.WriteDnsClass(Class); writer.WriteDnsType(Type, appendSpace: false); return(s.ToString()); } }
/// <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); }
/// <inheritdoc /> public void Write(PresentationWriter writer) { writer.WriteDomainName(Name); if (TTL != DefaultTTL) { writer.WriteTimeSpan32(TTL); } writer.WriteDnsClass(Class); writer.WriteDnsType(Type); WriteData(writer); writer.WriteEndOfLine(); }
/// <inheritdoc /> public override void WriteData(PresentationWriter writer) { writer.WriteDomainName(NextOwnerName); bool next = false; foreach (var type in Types) { if (next) { writer.WriteSpace(); } writer.WriteDnsType(type, appendSpace: false); next = true; } }