@@ -22,12 +22,10 @@ public sealed class DataProtectionKeyRingOptions
|
||||
if (string.IsNullOrWhiteSpace(CertificatePath))
|
||||
{
|
||||
if (requireCertificate)
|
||||
{
|
||||
throw new InvalidOperationException(
|
||||
"Data Protection certificate is required outside Development. " +
|
||||
"Configure Security:DataProtection:CertificatePath or " +
|
||||
"TIKU_DATA_PROTECTION_CERTIFICATE_PATH.");
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -36,8 +34,7 @@ public sealed class DataProtectionKeyRingOptions
|
||||
{
|
||||
var certificate = X509CertificateLoader.LoadPkcs12FromFile(
|
||||
Path.GetFullPath(CertificatePath.Trim()),
|
||||
CertificatePassword,
|
||||
X509KeyStorageFlags.DefaultKeySet);
|
||||
CertificatePassword);
|
||||
if (!certificate.HasPrivateKey)
|
||||
{
|
||||
certificate.Dispose();
|
||||
@@ -59,4 +56,4 @@ public sealed class DataProtectionKeyRingOptions
|
||||
exception);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user