IdentityShroud/IdentityShroud.Core/Security/RsaHelper.cs
eelke ccb06b260c Implement jwks endpoint and add test for it.
This also let to some improvements/cleanups of the other tests and fixtures.
2026-02-15 19:06:09 +01:00

16 lines
No EOL
365 B
C#

using System.Security.Cryptography;
namespace IdentityShroud.Core.Security;
public static class RsaHelper
{
/// <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;
}
}