mirror of
https://github.com/SpaceTimee/Sheas-Cealer.git
synced 2025-07-14 05:12:09 +08:00
1.1.1 -> 1.1.2 第34次更新
This commit is contained in:
parent
cbab9371a0
commit
3548125178
@ -22,7 +22,6 @@ using OnaCore;
|
|||||||
using Sheas_Cealer.Consts;
|
using Sheas_Cealer.Consts;
|
||||||
using Sheas_Cealer.Preses;
|
using Sheas_Cealer.Preses;
|
||||||
using Sheas_Cealer.Utils;
|
using Sheas_Cealer.Utils;
|
||||||
using Windows.Security.Cryptography.Certificates;
|
|
||||||
using YamlDotNet.RepresentationModel;
|
using YamlDotNet.RepresentationModel;
|
||||||
using File = System.IO.File;
|
using File = System.IO.File;
|
||||||
|
|
||||||
@ -183,14 +182,14 @@ public partial class MainWin : Window
|
|||||||
if (!Directory.Exists(tempPath))
|
if (!Directory.Exists(tempPath))
|
||||||
Directory.CreateDirectory(tempPath);
|
Directory.CreateDirectory(tempPath);
|
||||||
|
|
||||||
ECDsa certKey = ECDsa.Create();
|
RSA certKey = RSA.Create(2048);
|
||||||
|
|
||||||
CertificateRequest rootCertRequest = new("CN=Cealing Cert Root", certKey, HashAlgorithmName.SHA256);
|
CertificateRequest rootCertRequest = new("CN=Cealing Cert Root", certKey, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1);
|
||||||
rootCertRequest.CertificateExtensions.Add(new X509BasicConstraintsExtension(true, false, 0, true));
|
rootCertRequest.CertificateExtensions.Add(new X509BasicConstraintsExtension(true, false, 0, false));
|
||||||
|
|
||||||
X509Certificate2 rootCert = rootCertRequest.CreateSelfSigned(DateTimeOffset.UtcNow, DateTimeOffset.UtcNow.AddYears(100));
|
X509Certificate2 rootCert = rootCertRequest.CreateSelfSigned(DateTimeOffset.UtcNow, DateTimeOffset.UtcNow.AddYears(100));
|
||||||
|
|
||||||
CertificateRequest childCertRequest = new("CN=Cealing Cert Child", certKey, HashAlgorithmName.SHA256);
|
CertificateRequest childCertRequest = new("CN=Cealing Cert Child", certKey, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1);
|
||||||
|
|
||||||
SubjectAlternativeNameBuilder childCertSanBuilder = new();
|
SubjectAlternativeNameBuilder childCertSanBuilder = new();
|
||||||
foreach (List<(List<(string hostIncludeDomain, string hostExcludeDomain)> hostDomainPairs, string hostSni, string hostIp)> hostRules in HostRulesDict.Values)
|
foreach (List<(List<(string hostIncludeDomain, string hostExcludeDomain)> hostDomainPairs, string hostSni, string hostIp)> hostRules in HostRulesDict.Values)
|
||||||
@ -217,7 +216,7 @@ public partial class MainWin : Window
|
|||||||
|
|
||||||
using X509Store certStore = new(StoreName.Root, StoreLocation.CurrentUser, OpenFlags.ReadWrite);
|
using X509Store certStore = new(StoreName.Root, StoreLocation.CurrentUser, OpenFlags.ReadWrite);
|
||||||
bool isCertExist = false;
|
bool isCertExist = false;
|
||||||
|
|
||||||
foreach (X509Certificate2 cert in certStore.Certificates)
|
foreach (X509Certificate2 cert in certStore.Certificates)
|
||||||
if (cert.Subject == "CN=Cealing Cert Root")
|
if (cert.Subject == "CN=Cealing Cert Root")
|
||||||
isCertExist = true;
|
isCertExist = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user