Skip to content

Commit 06e0d58

Browse files
committed
Update Rsa usage example
1 parent 15966a4 commit 06e0d58

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

src/SafeCrypt.Test/Usage/RsaUsage.cs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,21 @@
44

55
namespace SafeCrypt.App.Usage;
66

7-
internal class RsaUsage
7+
internal static class RsaUsage
88
{
9-
internal protected async void Usage()
9+
internal static async void Execute()
1010
{
11+
Console.WriteLine("------- RSA Test Started -------");
12+
1113
// Example: Generate RSA keys
1214
var rsaKeyPair = KeyGenerators.GenerateRsaKeys(2048);
13-
1415
string rsaPublicKey = rsaKeyPair.Item1;
1516
string rsaPrivateKey = rsaKeyPair.Item2;
1617

1718
Console.WriteLine($"pubic key {rsaPublicKey}");
19+
20+
Console.WriteLine();
21+
1822
Console.WriteLine($"private key {rsaPrivateKey}");
1923

2024
// Example: Encrypt and Decrypt using RSA
@@ -30,6 +34,8 @@ internal protected async void Usage()
3034

3135
Console.WriteLine($"Original Data: {originalData}");
3236

37+
Console.WriteLine();
38+
3339
Console.WriteLine("Original byte array: " + BitConverter.ToString(encryptedData.EncryptedData));
3440
string EncryptedDataconvertedString = Convert.ToBase64String(encryptedData.EncryptedData);
3541

@@ -49,6 +55,8 @@ internal protected async void Usage()
4955
var decryptedData = await Rsa.DecryptAsync(decryptionModel);
5056
Console.WriteLine($"{decryptedData.DecryptedData}");
5157

52-
Console.ReadLine();
58+
Console.WriteLine();
59+
60+
Console.WriteLine("------- RSA Test Ended -------");
5361
}
5462
}

0 commit comments

Comments
 (0)