Skip to content

Commit dd35342

Browse files
committed
GSF.Core: Don't use X509Certificate2.PrivateKey property
1 parent f9027a7 commit dd35342

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)