Example #1
0
        /// <summary>
        /// Reads data into this RR from the DNS wire format data in <paramref name="reader"/>
        /// </summary>
        /// <param name="reader">Reader in which wire format data for this RR is already buffered.</param>
        protected override void DeserializeRecordData(ref DnsBufferReader reader)
        {
            ushort certType = reader.ReadUShort();

            if (certType > (ushort)CertificateType.IACPKIK)
            {
                throw new DnsProtocolException(DnsProtocolError.InvalidCertRecord);
            }
            m_certType  = (CertificateType)certType;
            m_keyTag    = reader.ReadUShort();
            m_algorithm = reader.ReadByte();
            m_certData  = reader.ReadBytes(this.RecordDataLength - 5); // 5 == # of bytes we've already read (certType, keytag etc)

            this.EnsureDnsCert();
        }
Example #2
0
        /// <summary>
        /// Reads data into this RR from the DNS wire format data in <paramref name="reader"/>
        /// </summary>
        /// <param name="reader">Reader in which wire format data for this RR is already buffered.</param>
        protected override void DeserializeRecordData(ref DnsBufferReader reader)
        {
            List <string> stringList = new List <string>();

            int maxIndex = reader.Index + this.RecordDataLength;

            while (reader.Index < maxIndex)
            {
                StringBuilder sb = reader.EnsureStringBuilder();
                int           cb = reader.ReadByte();
                while (cb-- > 0)
                {
                    sb.Append(reader.ReadChar());
                }
                stringList.Add(sb.ToString());
            }

            this.Strings = stringList;
        }
Example #3
0
        /// <summary>
        /// Reads data into this RR from the DNS wire format data in <paramref name="reader"/>
        /// </summary>
        /// <param name="reader">Reader in which wire format data for this RR is already buffered.</param>
        protected override void DeserializeRecordData(ref DnsBufferReader reader)
        {
            List<string> stringList = new List<string>();

            int maxIndex = reader.Index + this.RecordDataLength;
            while (reader.Index < maxIndex)
            {
                StringBuilder sb = reader.EnsureStringBuilder();
                int cb = reader.ReadByte();
                while (cb-- > 0)
                {
                    sb.Append(reader.ReadChar());
                }
                stringList.Add(sb.ToString());
            }

            this.Strings = stringList;
        }
Example #4
0
 /// <summary>
 /// Reads data into this RR from the DNS wire format data in <paramref name="reader"/>
 /// </summary>
 /// <param name="reader">Reader in which wire format data for this RR is already buffered.</param>
 protected override void DeserializeRecordData(ref DnsBufferReader reader)
 {
     ushort certType = reader.ReadUShort();
     if (certType > (ushort) CertificateType.IACPKIK)
     {
         throw new DnsProtocolException(DnsProtocolError.InvalidCertRecord);
     } 
     m_certType = (CertificateType) certType;
     m_keyTag = reader.ReadUShort();
     m_algorithm = reader.ReadByte();
     m_certData = reader.ReadBytes(this.RecordDataLength - 5); // 5 == # of bytes we've already read (certType, keytag etc)
     
     this.EnsureDnsCert();            
 }