示例#1
0
        public void Test_bytebytebyte_Sig()
        {
#if DEBUG
            byte[] sig = new byte[] {
                0x78, 0x62, 0x66, 0xED, 0xE4, 0xBB, 0x8B, 0x2F, 0x1F, 0x1F, 0x3E, 0x29, 0xF0, 0xF1, 0xB6, 0x6D,
                0xDF, 0x95, 0x0C, 0xB9, 0x4B, 0x8A, 0xFD, 0xFF, 0xB6, 0x71, 0xCA, 0x44, 0x7E, 0x91, 0xA2, 0x20,
                0x68, 0x15, 0x8D, 0x3A, 0xF3, 0x49, 0xF9, 0xD4, 0x5B, 0x29, 0xDD, 0x75, 0x59, 0x5A, 0xAB, 0x3C,
                0xBD, 0x1F, 0x55, 0xC5, 0xEF, 0xBC, 0xDC, 0xB7, 0x7C, 0x09, 0xC5, 0x38, 0x3A, 0x16, 0x7D, 0x45,
                0xD4, 0x25, 0xA1, 0xB7, 0xF2, 0x96, 0xD5, 0x41, 0xFA, 0xA5, 0x67, 0xE7, 0xD3, 0xC0, 0x0F, 0x78,
                0x3A, 0xE0, 0x64, 0xD4, 0xB9, 0x9B, 0x20, 0xC1, 0x46, 0x48, 0x3C, 0xE0, 0x95, 0x4C, 0x89, 0x98,
                0x6A, 0x6C, 0x71, 0x4D, 0x83, 0xB4, 0xFE, 0xAE, 0x50, 0x76, 0xFD, 0x5D, 0x91, 0x68, 0x85, 0x49,
                0x1C, 0x8A, 0x42, 0xFB, 0x4D, 0x57, 0x9F, 0xC3, 0x24, 0x94, 0xCA, 0x91, 0x31, 0x29, 0x20, 0x4D,
                0xB3, 0x5F, 0xB5, 0x84, 0xCC, 0xF6, 0xB4, 0x23, 0x0E, 0x78, 0x75, 0x79, 0x06, 0xE7, 0x57, 0xE6,
                0x15, 0xF5, 0xB3, 0xE5, 0xE4, 0xC4, 0xAF, 0xBF, 0x03, 0x9B, 0x59, 0x32, 0x25, 0x04, 0xC3, 0x00,
                0x31, 0xFF, 0x5B, 0xE2, 0x59, 0x8B, 0xDC, 0xB7, 0x7B, 0xAE, 0x4C, 0xC0, 0x50, 0x31, 0xE4, 0xCD,
                0x78, 0x5B, 0xAB, 0x71, 0xE0, 0x40, 0xFF, 0xBA, 0xE2, 0xD5, 0xF7, 0x4C, 0xE6, 0xFB, 0x7B, 0x80,
                0x40, 0x9E, 0x06, 0x8C, 0xAE, 0x8D, 0xC3, 0x93, 0x46, 0x35, 0x5C, 0x65, 0x78, 0x93, 0xEE, 0xA5,
                0x46, 0x23, 0xD6, 0xB3, 0xF2, 0xC8, 0x81, 0xD6, 0x47, 0x43, 0x80, 0xF0, 0x9E, 0xE7, 0xFF, 0xA9,
                0x91, 0x6F, 0x48, 0x38, 0x9D, 0xAA, 0x25, 0x3E, 0xF0, 0xE1, 0xB6, 0x9E, 0x6B, 0xC0, 0x51, 0xC5,
                0x28, 0xA1, 0x49, 0x45, 0xC9, 0x69, 0xED, 0xC1, 0x1E, 0xE8, 0x89, 0x38, 0x47, 0xD3, 0x34, 0x03
            };

            byte[] data = Encoding.ASCII.GetBytes("123456789");
            byte[] cer  = Certificates.ExtractMainCER();
            Assert.AreEqual(true, Certificates.Verify(data, sig, cer));
#else
            //ExtractMainCER() is not available in Release Mode
            Assert.AreEqual(true, true);
#endif
        }