refactor(Core.Security): Entfernt die Erweiterungsmethoden im aktuellen Projekt.
- Projekt Security.Extensions hinzugefügt.
This commit is contained in:
parent
8cc6fd95f7
commit
51ebf3fa67
@ -6,4 +6,8 @@
|
|||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\DigitalData.Core.Security.Extensions\DigitalData.Core.Security.Extensions.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@ -1,13 +0,0 @@
|
|||||||
namespace DigitalData.Core.Security
|
|
||||||
{
|
|
||||||
public static class Extensions
|
|
||||||
{
|
|
||||||
public static string ToBase64String(this byte[] bytes) => Convert.ToBase64String(bytes);
|
|
||||||
|
|
||||||
public static byte[] Base64ToByte(this string base64String) => Convert.FromBase64String(base64String);
|
|
||||||
|
|
||||||
public static byte[] ToBytes(this string str) => System.Text.Encoding.UTF8.GetBytes(str);
|
|
||||||
|
|
||||||
public static string BytesToString(this byte[] bytes) => System.Text.Encoding.UTF8.GetString(bytes);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,4 +1,6 @@
|
|||||||
namespace DigitalData.Core.Security
|
using DigitalData.Core.Security.Extensions;
|
||||||
|
|
||||||
|
namespace DigitalData.Core.Security
|
||||||
{
|
{
|
||||||
public class RSADecryptor : RSACryptographer
|
public class RSADecryptor : RSACryptographer
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,4 +1,6 @@
|
|||||||
namespace DigitalData.Core.Security
|
using DigitalData.Core.Security.Extensions;
|
||||||
|
|
||||||
|
namespace DigitalData.Core.Security
|
||||||
{
|
{
|
||||||
public class RSAEncryptor : RSACryptographer
|
public class RSAEncryptor : RSACryptographer
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,14 +0,0 @@
|
|||||||
using System.Security.Cryptography;
|
|
||||||
|
|
||||||
namespace DigitalData.Core.Security
|
|
||||||
{
|
|
||||||
public static class RSAExtensions
|
|
||||||
{
|
|
||||||
public static RSA ToRSA(this string pem)
|
|
||||||
{
|
|
||||||
var rsa = RSA.Create();
|
|
||||||
rsa.ImportFromPem(pem);
|
|
||||||
return rsa;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
x
Reference in New Issue
Block a user