IdentityShroud/IdentityShroud.TestUtils/Substitutes/NullDekEncryptionService.cs
2026-08-18 07:42:51 +02:00

28 lines
No EOL
654 B
C#

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());
}
public void Decrypt(EncryptedDek input, Span<byte> output)
{
input.Value.CopyTo(output);
}
public int GetDecryptedSize(EncryptedDek input)
{
return input.Value.Length;
}
public byte[] Decrypt(EncryptedDek input)
{
return input.Value;
}
}