BoxKite.Twitter.Console.SecureIt.DecryptString C# (CSharp) Method

DecryptString() public static method

public static DecryptString ( this encryptedData ) : SecureString
encryptedData this
return System.Security.SecureString
        public static SecureString DecryptString(this string encryptedData)
        {
            if (encryptedData == null)
            {
                return null;
            }

            try
            {
                var decryptedData = ProtectedData.Unprotect(
                    Convert.FromBase64String(encryptedData),
                    entropy,
                    DataProtectionScope.CurrentUser);

                return Encoding.Unicode.GetString(decryptedData).ToSecureString();
            }
            catch
            {
                return new SecureString();
            }
        }