Ejemplo n.º 1
0
        public void Create()
        {
            var option = EdnsDAUOption.Create();

            Assert.AreEqual(EdnsOptionType.DAU, option.Type);
            CollectionAssert.AreEqual(SecurityAlgorithmRegistry.Algorithms.Keys, option.Algorithms);
        }
Ejemplo n.º 2
0
        /// <summary>
        ///   Create a new instance of the <see cref="EdnsDAUOption"/> class with
        ///   the known/implemented security algorithms.
        /// </summary>
        /// <remarks>
        ///   The <see cref="Algorithms"/> are obtained from the <see cref="SecurityAlgorithmRegistry"/>.
        /// </remarks>
        public static EdnsDAUOption Create()
        {
            var option = new EdnsDAUOption();

            option.Algorithms.AddRange(SecurityAlgorithmRegistry.Algorithms.Keys);
            return(option);
        }
Ejemplo n.º 3
0
        public void Roundtrip()
        {
            var opt1     = new OPTRecord();
            var expected = new EdnsDAUOption
            {
                Algorithms = { SecurityAlgorithm.ED25519, SecurityAlgorithm.ECCGOST }
            };

            Assert.AreEqual(EdnsOptionType.DAU, expected.Type);
            opt1.Options.Add(expected);

            var opt2   = (OPTRecord) new ResourceRecord().Read(opt1.ToByteArray());
            var actual = (EdnsDAUOption)opt2.Options[0];

            Assert.AreEqual(expected.Type, actual.Type);
            CollectionAssert.AreEqual(expected.Algorithms, actual.Algorithms);
        }