Add PKCS#11 startup self-test health reporting
This commit is contained in:
@@ -8,7 +8,7 @@ internal static class Pkcs11ToolBridge
|
||||
{
|
||||
public static bool IsAvailable(Pkcs11Options options)
|
||||
{
|
||||
return !string.IsNullOrWhiteSpace(options.ToolPath) && File.Exists(options.ToolPath);
|
||||
return !string.IsNullOrWhiteSpace(options.ResolvedToolPath) && File.Exists(options.ResolvedToolPath);
|
||||
}
|
||||
|
||||
public static byte[] ReadCertificateBytes(Pkcs11Options options)
|
||||
@@ -75,7 +75,7 @@ internal static class Pkcs11ToolBridge
|
||||
var args = new List<string>
|
||||
{
|
||||
"--module",
|
||||
options.LibraryPath,
|
||||
options.ResolvedLibraryPath,
|
||||
"--login",
|
||||
"--pin",
|
||||
options.UserPin
|
||||
@@ -101,7 +101,7 @@ internal static class Pkcs11ToolBridge
|
||||
{
|
||||
StartInfo = new ProcessStartInfo
|
||||
{
|
||||
FileName = options.ToolPath!,
|
||||
FileName = options.ResolvedToolPath!,
|
||||
UseShellExecute = false,
|
||||
RedirectStandardOutput = true,
|
||||
RedirectStandardError = true,
|
||||
@@ -136,7 +136,7 @@ internal static class Pkcs11ToolBridge
|
||||
private static void EnsureAvailable(Pkcs11Options options)
|
||||
{
|
||||
if (!IsAvailable(options))
|
||||
throw new InvalidOperationException("pkcs11-tool is not available. Configure Crypt:Pkcs11:ToolPath.");
|
||||
throw new InvalidOperationException("pkcs11-tool is not available at resolved pkcs11 assets path.");
|
||||
}
|
||||
|
||||
private static void DeleteIfExists(string path)
|
||||
|
||||
Reference in New Issue
Block a user