2026-02-27 17:57:42 +00:00
|
|
|
using IdentityShroud.Core.Contracts;
|
|
|
|
|
using IdentityShroud.Core.Security;
|
|
|
|
|
|
|
|
|
|
namespace IdentityShroud.TestUtils.Substitutes;
|
|
|
|
|
|
|
|
|
|
public class NullDekEncryptionService : IDekEncryptionService
|
|
|
|
|
{
|
|
|
|
|
public KekId KeyId { get; } = KekId.NewId();
|
|
|
|
|
public EncryptedDek Encrypt(ReadOnlySpan<byte> plain)
|
|
|
|
|
{
|
|
|
|
|
return new(KeyId, plain.ToArray());
|
|
|
|
|
}
|
|
|
|
|
|
2026-08-18 07:40:24 +02:00
|
|
|
public void Decrypt(EncryptedDek input, Span<byte> output)
|
|
|
|
|
{
|
|
|
|
|
input.Value.CopyTo(output);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int GetDecryptedSize(EncryptedDek input)
|
|
|
|
|
{
|
|
|
|
|
return input.Value.Length;
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-27 17:57:42 +00:00
|
|
|
public byte[] Decrypt(EncryptedDek input)
|
|
|
|
|
{
|
|
|
|
|
return input.Value;
|
|
|
|
|
}
|
|
|
|
|
}
|