18 lines
No EOL
382 B
C#
18 lines
No EOL
382 B
C#
using System.Security.Cryptography;
|
|
|
|
namespace IdentityShroud.SecretProviders;
|
|
|
|
public sealed class PlainSecret(byte[] secret) : IDisposable
|
|
{
|
|
private bool _disposed;
|
|
|
|
public ReadOnlySpan<byte> Secret => secret;
|
|
|
|
public void Dispose()
|
|
{
|
|
if (_disposed)
|
|
return;
|
|
_disposed = true;
|
|
CryptographicOperations.ZeroMemory(secret);
|
|
}
|
|
} |