16 lines
479 B
C#
16 lines
479 B
C#
using IdentityShroud.Core.Contracts;
|
|
using IdentityShroud.Core.Security.Keys;
|
|
|
|
namespace IdentityShroud.Core.Services;
|
|
|
|
public class KeyService(
|
|
IKeyProviderFactory keyProviderFactory) : IKeyService
|
|
{
|
|
public CreateKeyResponse CreateKey(KeyPolicy policy)
|
|
{
|
|
IKeyProvider provider = keyProviderFactory.CreateProvider(policy.KeyType);
|
|
KeyData plainKey = provider.CreateKey(policy);
|
|
|
|
return new CreateKeyResponse(policy.KeyType, plainKey);
|
|
}
|
|
}
|