Exemple #1
0
        private static void ProcessTestCase(SimpleEncoderTestCase testCase, X500DistinguishedName dn)
        {
            // The simple encoding test is "does it output the expected text?", then
            // we'll move on to the exact bytes.
            Assert.Equal(testCase.GetNormalizedValue(), dn.Format(false));

            string expectedHex;

            if (OperatingSystem.IsWindows())
            {
                expectedHex = testCase.GetBmpEncoding() ?? testCase.GetPreferredEncoding();
            }
            else
            {
                expectedHex = testCase.GetPreferredEncoding();
            }

            string actualHex = dn.RawData.ByteArrayToHex();

            Assert.Equal(expectedHex, actualHex);
        }
Exemple #2
0
        public static void EncodeSingleRdn(SimpleEncoderTestCase testCase)
        {
            X500DistinguishedName dn = new X500DistinguishedName(testCase.Input, X500DistinguishedNameFlags.None);

            ProcessTestCase(testCase, dn);
        }
Exemple #3
0
        public static void CheckParserBoundaryCases(SimpleEncoderTestCase testCase)
        {
            X500DistinguishedName dn = new X500DistinguishedName(testCase.Input, X500DistinguishedNameFlags.None);

            ProcessTestCase(testCase, dn);
        }