2026-02-08 11:57:57 +01:00
|
|
|
using System.Security.Cryptography;
|
|
|
|
|
|
|
|
|
|
namespace IdentityShroud.Core.Security;
|
|
|
|
|
|
|
|
|
|
public static class RsaHelper
|
|
|
|
|
{
|
2026-02-15 19:06:09 +01:00
|
|
|
/// <summary>
|
|
|
|
|
/// Load RSA private key from PKCS#8 format
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static RSA LoadFromPkcs8(byte[] pkcs8Key)
|
|
|
|
|
{
|
|
|
|
|
var rsa = RSA.Create();
|
|
|
|
|
rsa.ImportPkcs8PrivateKey(pkcs8Key, out _);
|
|
|
|
|
return rsa;
|
|
|
|
|
}
|
2026-02-08 11:57:57 +01:00
|
|
|
}
|