コード例 #1
0
        /// <inheritdoc />
        public override void ReadData(WireReader reader, int length)
        {
            var end = reader.Position + length;

            Flags     = (DNSKEYFlags)reader.ReadUInt16();
            Protocol  = reader.ReadByte();
            Algorithm = (SecurityAlgorithm)reader.ReadByte();
            PublicKey = reader.ReadBytes(end - reader.Position);
        }
コード例 #2
0
ファイル: NSEC3PARAMRecord .cs プロジェクト: schmitch/net-dns
        /// <inheritdoc />
        public override void ReadData(WireReader reader, int length)
        {
            var end = reader.Position + length;

            HashAlgorithm = (DigestType)reader.ReadByte();
            Flags         = reader.ReadByte();
            Iterations    = reader.ReadUInt16();
            Salt          = reader.ReadByteLengthPrefixedBytes();
        }
コード例 #3
0
        /// <inheritdoc />
        public override void ReadData(WireReader reader, int length)
        {
            var end = reader.Position + length;

            KeyTag        = reader.ReadUInt16();
            Algorithm     = (SecurityAlgorithm)reader.ReadByte();
            HashAlgorithm = (DigestType)reader.ReadByte();
            Digest        = reader.ReadBytes(end - reader.Position);
        }
コード例 #4
0
ファイル: RRSIGRecord.cs プロジェクト: schmitch/net-dns
        /// <inheritdoc />
        public override void ReadData(WireReader reader, int length)
        {
            var end = reader.Position + length;

            TypeCovered         = (DnsType)reader.ReadUInt16();
            Algorithm           = (SecurityAlgorithm)reader.ReadByte();
            Labels              = reader.ReadByte();
            OriginalTTL         = reader.ReadTimeSpan32();
            SignatureExpiration = reader.ReadDateTime32();
            SignatureInception  = reader.ReadDateTime32();
            KeyTag              = reader.ReadUInt16();
            SignerName          = reader.ReadDomainName();
            Signature           = reader.ReadBytes(end - reader.Position);
        }
コード例 #5
0
        /// <inheritdoc />
        public override void ReadData(WireReader reader, int length)
        {
            var end = reader.Position + length;

            HashAlgorithm       = (DigestType)reader.ReadByte();
            Flags               = (NSEC3Flags)reader.ReadByte();
            Iterations          = reader.ReadUInt16();
            Salt                = reader.ReadByteLengthPrefixedBytes();
            NextHashedOwnerName = reader.ReadByteLengthPrefixedBytes();

            while (reader.Position < end)
            {
                Types.AddRange(reader.ReadBitmap().Select(t => (DnsType)t));
            }
        }
コード例 #6
0
        public void BufferOverflow_Byte()
        {
            var ms     = new MemoryStream(new byte[0]);
            var reader = new WireReader(ms);

            ExceptionAssert.Throws <EndOfStreamException>(() => reader.ReadByte());
        }
コード例 #7
0
 /// <inheritdoc />
 public override void ReadData(WireReader reader, int length)
 {
     Algorithms.Clear();
     for (; length > 0; --length)
     {
         Algorithms.Add((SecurityAlgorithm)reader.ReadByte());
     }
 }