Updated Structure, and fixed paths.
- Project does not work still in this version as communication is still not happening between Client/Server/Core. Fake UI is still somewhat needed to progress
This commit is contained in:
20
RelayClient/Crypto/KeyStorage.cs
Normal file
20
RelayClient/Crypto/KeyStorage.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
namespace RelayClient.Crypto;
|
||||
|
||||
public static class KeyStorage
|
||||
{
|
||||
public static void SavePrivateKey(string username, string privateKey)
|
||||
{
|
||||
Directory.CreateDirectory("keys");
|
||||
File.WriteAllText(Path.Combine("keys", $"{username}.private.key"), privateKey);
|
||||
}
|
||||
|
||||
public static string LoadPrivateKey(string username)
|
||||
{
|
||||
return File.ReadAllText(Path.Combine("keys", $"{username}.private.key"));
|
||||
}
|
||||
|
||||
public static bool PrivateKeyExists(string username)
|
||||
{
|
||||
return File.Exists(Path.Combine("keys", $"{username}.private.key"));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user