Skip to content

Commit 2cc4fdf

Browse files
Merge pull request #483 from GridProtectionAlliance/get-rsa-private-key
GSF.Core: Don't use X509Certificate2.PrivateKey property
2 parents f9027a7 + dd35342 commit 2cc4fdf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Source/Libraries/GSF.Core/Net/Security/CertificateGenerator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ private static bool CanAccessPrivateKey(X509Certificate2 certificate)
411411
// The point here is not only to check if the certificate has a private key,
412412
// but also to attempt to access its private key, since doing so might result
413413
// in a CryptographicException; certificate.HasPrivateKey will not work
414-
return certificate.PrivateKey is not null;
414+
return certificate.GetRSAPrivateKey() is not null;
415415
}
416416
catch (CryptographicException)
417417
{

0 commit comments

Comments
 (0)