mirror of
https://github.com/QL-Win/QuickLook.git
synced 2026-01-13 07:05:24 +08:00
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.
This commit is contained in:
@@ -8,15 +8,17 @@ internal sealed class CertLoadResult
|
||||
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)
|
||||
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)
|
||||
=> new CertLoadResult(success, certificate, message, rawContent);
|
||||
public static CertLoadResult From(bool success, X509Certificate2 certificate, string message, string rawContent, bool needsPassword = false)
|
||||
=> new CertLoadResult(success, certificate, message, rawContent, needsPassword);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user