Пример #1
0
        public static void SerializeDefaultValue_AsNonDefault()
        {
            var extension = new X509DeserializeTests.Extension
            {
                ExtnId    = "2.5.29.15",
                Critical  = true,
                ExtnValue = new byte[] { 0x03, 0x02, 0x05, 0xA0 },
            };

            AsnWriter writer = AsnSerializer.Serialize(extension, AsnEncodingRules.DER);

            Assert.Equal("300E0603551D0F0101FF0404030205A0", writer.Encode().ByteArrayToHex());
        }
Пример #2
0
        public static void SerializeDefaultValue_AsDefault()
        {
            var extension = new X509DeserializeTests.Extension
            {
                ExtnId    = "2.5.29.19",
                Critical  = false,
                ExtnValue = new byte[] { 0x30, 0x00 },
            };

            AsnWriter writer = AsnSerializer.Serialize(extension, AsnEncodingRules.DER);

            Assert.Equal("30090603551D1304023000", writer.Encode().ByteArrayToHex());
        }