2026-03-16 19:15:04 +01:00
|
|
|
using IdentityShroud.Core.Security.Keys.Aes;
|
2026-02-27 17:57:42 +00:00
|
|
|
using IdentityShroud.Core.Security.Keys.Rsa;
|
|
|
|
|
|
|
|
|
|
namespace IdentityShroud.Core.Security.Keys;
|
|
|
|
|
|
|
|
|
|
public class KeyProviderFactory : IKeyProviderFactory
|
|
|
|
|
{
|
2026-03-16 19:15:04 +01:00
|
|
|
public IKeyProvider CreateProvider(KeyType keyType)
|
2026-02-27 17:57:42 +00:00
|
|
|
{
|
2026-03-16 19:15:04 +01:00
|
|
|
switch (keyType.Name)
|
2026-02-27 17:57:42 +00:00
|
|
|
{
|
|
|
|
|
case "RSA":
|
|
|
|
|
return new RsaProvider();
|
2026-03-16 19:15:04 +01:00
|
|
|
case "AES":
|
|
|
|
|
return new AesProvider();
|
2026-02-27 17:57:42 +00:00
|
|
|
default:
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|