コード例 #1
0
ファイル: JhEncryptTest.cs プロジェクト: crcruicai/Library
 public void DecryptTest()
 {
     byte[] encrypted = null;
     byte[] expected  = null;
     byte[] actual;
     actual = JhEncrypt.Decrypt(encrypted);
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("验证此测试方法的正确性。");
 }
コード例 #2
0
ファイル: JhEncryptTest.cs プロジェクト: crcruicai/Library
        public void DecryptTest4()
        {
            string original = string.Empty;
            string expected = string.Empty;
            string actual;

            actual = JhEncrypt.Decrypt(original);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("验证此测试方法的正确性。");
        }
コード例 #3
0
ファイル: JhEncryptTest.cs プロジェクト: crcruicai/Library
        public void DecryptTest1()
        {
            string   encrypted = string.Empty;
            string   key       = string.Empty;
            Encoding encoding  = null;
            string   expected  = string.Empty;
            string   actual;

            actual = JhEncrypt.Decrypt(encrypted, key, encoding);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("验证此测试方法的正确性。");
        }
コード例 #4
0
ファイル: Packet.cs プロジェクト: wangyulong0505/Galaxy
        public static T DePacketData(byte[] content, string strKey)
        {
            JsonSerializerSettings setting = new JsonSerializerSettings();

            setting.NullValueHandling = NullValueHandling.Ignore;                       //忽略为NULL的值
            T      t;
            string strJson = SerializeHelper.DeserializeWithBinary(content).ToString(); //反序列化

            strJson = JhEncrypt.Decrypt(strJson, strKey);                               //解密
            t       = (T)JsonConvert.DeserializeObject(strJson, typeof(T), setting);    //json转对象

            return(t);
        }