summaryrefslogtreecommitdiff
path: root/src/IAuthenticator.cs
diff options
context:
space:
mode:
authorLibravatar vnugent <public@vaughnnugent.com>2023-03-19 16:39:03 -0400
committerLibravatar vnugent <public@vaughnnugent.com>2023-03-19 16:39:03 -0400
commite8af88efdae6ff3ef4780627430f31dca9cc665b (patch)
treeafef9edb1c4345f7dc03eb6d1a3d88f7e62fae68 /src/IAuthenticator.cs
Initial commit
Diffstat (limited to 'src/IAuthenticator.cs')
-rw-r--r--src/IAuthenticator.cs40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/IAuthenticator.cs b/src/IAuthenticator.cs
new file mode 100644
index 0000000..440a69f
--- /dev/null
+++ b/src/IAuthenticator.cs
@@ -0,0 +1,40 @@
+
+using System;
+using System.Security.Cryptography.X509Certificates;
+
+using Yubico.YubiKey.Piv;
+
+using VNLib.Hashing.IdentityUtility;
+
+namespace PkiAuthenticator
+{
+ /// <summary>
+ /// Represents an authenticaion device, backed by hardware or software keys.
+ /// </summary>
+ public interface IAuthenticator : IJwtSignatureProvider, IDisposable
+ {
+ /// <summary>
+ /// The signature algorithm the devices/keys support.
+ /// </summary>
+ PivAlgorithm KeyAlgorithm { get; }
+
+ /// <summary>
+ /// Gets the public/key certificate for the authenticator
+ /// </summary>
+ /// <returns>The certificate</returns>
+ X509Certificate2 GetCertificate();
+
+ /// <summary>
+ /// Initialies the authenticator's assets required for performing
+ /// authentication functions.
+ /// </summary>
+ /// <returns>True if the authenticator was successfully initialized.</returns>
+ bool Initialize();
+
+ /// <summary>
+ /// Writes the internal devices to the log output
+ /// </summary>
+ /// <returns>The exit code for the process, 0 if successful, non-zero if the operation failed</returns>
+ int ListDevices();
+ }
+} \ No newline at end of file