コード例 #1
0
        public void CryptoString_TestUtilityMethods()
        {
            string password = "******";
            int    length   = 100;

            string random = CryptoString.GenerateRandomText(length);

            Assert.IsTrue(random.Length > (length / 2));

            string byteString = CryptoString.BytesToString(new ByteGenerator().GenerateBytes(length));

            Assert.IsTrue(byteString.Length > 0);


            // String conversions
            SecureString secureString   = CryptoString.StringToSecureString(password);
            string       unsecureString = CryptoString.SecureStringToString(secureString);

            Assert.IsTrue(password.Equals(unsecureString));
        }