Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions Extensions/StringExtension.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security;

namespace ISBoxerEVELauncher.Extensions
{
Expand Down Expand Up @@ -117,5 +118,19 @@ public static string SHA256(this string plaintext)
{
return ISBoxerEVELauncher.Security.SHA256.GenerateString(plaintext);
}

public static SecureString ToSecureString(this string str)
{
if (str == null)
throw new ArgumentNullException("str");

var secureStr = new SecureString();
foreach (char c in str)
{
secureStr.AppendChar(c);
}
secureStr.MakeReadOnly();
return secureStr;
}
}
}
Loading