/// <summary>
 /// Two DnsResourceDataSignature are equal iff their type covered, algorithm, labels, original TTL, signature expiration, signature inception, key tag,
 /// signer's name and signature fields are equal.
 /// </summary>
 public bool Equals(DnsResourceDataSignature other)
 {
     return(other != null &&
            TypeCovered.Equals(other.TypeCovered) &&
            Algorithm.Equals(other.Algorithm) &&
            Labels.Equals(other.Labels) &&
            OriginalTtl.Equals(other.OriginalTtl) &&
            SignatureExpiration.Equals(other.SignatureExpiration) &&
            SignatureInception.Equals(other.SignatureInception) &&
            KeyTag.Equals(other.KeyTag) &&
            SignersName.Equals(other.SignersName) &&
            Signature.Equals(other.Signature));
 }
        internal override int WriteData(byte[] buffer, int dnsOffset, int offsetInDns, DnsDomainNameCompressionData compressionData)
        {
            buffer.Write(dnsOffset + offsetInDns + Offset.TypeCovered, (ushort)TypeCovered, Endianity.Big);
            buffer.Write(dnsOffset + offsetInDns + Offset.Algorithm, (byte)Algorithm);
            buffer.Write(dnsOffset + offsetInDns + Offset.Labels, Labels);
            buffer.Write(dnsOffset + offsetInDns + Offset.OriginalTtl, OriginalTtl, Endianity.Big);
            buffer.Write(dnsOffset + offsetInDns + Offset.SignatureExpiration, SignatureExpiration.Value, Endianity.Big);
            buffer.Write(dnsOffset + offsetInDns + Offset.SignatureInception, SignatureInception.Value, Endianity.Big);
            buffer.Write(dnsOffset + offsetInDns + Offset.KeyTag, KeyTag, Endianity.Big);

            int numBytesWritten = ConstantPartLength;

            numBytesWritten += SignersName.Write(buffer, dnsOffset, compressionData, offsetInDns + numBytesWritten);

            Signature.Write(buffer, dnsOffset + offsetInDns + numBytesWritten);
            return(numBytesWritten + Signature.Length);
        }
 internal override int GetLength(DnsDomainNameCompressionData compressionData, int offsetInDns)
 {
     return(ConstantPartLength + SignersName.GetLength(compressionData, offsetInDns) + Signature.Length);
 }