Files
QuickLook/QuickLook.Plugin/QuickLook.Plugin.CertViewer/CertLoadResult.cs
ema 06694e0b16
Some checks failed
build / build (push) Has been cancelled
build / publish (push) Has been cancelled
Add password support for protected certificates
Introduces UI and logic to handle password-protected certificate files. The CertViewerControl now prompts for a password if needed, and attempts to reload the certificate with the provided password. Refactored certificate loading flow to support this feature.
2025-12-23 14:41:59 +08:00

25 lines
871 B
C#

using System.Security.Cryptography.X509Certificates;
namespace QuickLook.Plugin.CertViewer;
internal sealed class CertLoadResult
{
public bool Success { get; }
public X509Certificate2 Certificate { get; }
public string Message { get; }
public string RawContent { get; }
public bool NeedsPassword { get; }
public CertLoadResult(bool success, X509Certificate2 certificate, string message, string rawContent, bool needsPassword = false)
{
Success = success;
Certificate = certificate;
Message = message;
RawContent = rawContent;
NeedsPassword = needsPassword;
}
public static CertLoadResult From(bool success, X509Certificate2 certificate, string message, string rawContent, bool needsPassword = false)
=> new CertLoadResult(success, certificate, message, rawContent, needsPassword);
}