17 lines
411 B
C#
17 lines
411 B
C#
using System.Security.Cryptography.X509Certificates;
|
|
using NATS.Server.Protocol;
|
|
|
|
namespace NATS.Server.Auth;
|
|
|
|
public interface IAuthenticator
|
|
{
|
|
AuthResult? Authenticate(ClientAuthContext context);
|
|
}
|
|
|
|
public sealed class ClientAuthContext
|
|
{
|
|
public required ClientOptions Opts { get; init; }
|
|
public required byte[] Nonce { get; init; }
|
|
public X509Certificate2? ClientCertificate { get; init; }
|
|
}
|