25 lines
No EOL
645 B
C#
25 lines
No EOL
645 B
C#
using System.Security.Cryptography;
|
|
using IdentityShroud.Core.Contracts;
|
|
using IdentityShroud.Core.Messages;
|
|
using IdentityShroud.Core.Model;
|
|
using IdentityShroud.Core.Security;
|
|
using Microsoft.AspNetCore.WebUtilities;
|
|
|
|
namespace IdentityShroud.Api.Mappers;
|
|
|
|
public class KeyMapper(IKeyService keyService)
|
|
{
|
|
public JsonWebKeySet KeyListToJsonWebKeySet(IEnumerable<RealmKey> keys)
|
|
{
|
|
JsonWebKeySet wks = new();
|
|
foreach (var k in keys)
|
|
{
|
|
var wk = keyService.CreateJsonWebKey(k);
|
|
if (wk is {})
|
|
{
|
|
wks.Keys.Add(wk);
|
|
}
|
|
}
|
|
return wks;
|
|
}
|
|
} |