We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 71e34ed commit 29b1ac1Copy full SHA for 29b1ac1
mcs/class/System/Mono.Btls/X509CertificateImplBtls.cs
@@ -198,11 +198,14 @@ public override AsymmetricAlgorithm PrivateKey {
198
set {
199
if (nativePrivateKey != null)
200
nativePrivateKey.Dispose ();
201
- if (value == null) {
+ try {
202
+ // FIXME: there doesn't seem to be a public API to check whether it actually
203
+ // contains a private key (apart from RSAManaged.PublicOnly).
204
+ if (value != null)
205
+ nativePrivateKey = MonoBtlsKey.CreateFromRSAPrivateKey ((RSA)value);
206
+ } catch {
207
nativePrivateKey = null;
- return;
208
}
- nativePrivateKey = MonoBtlsKey.CreateFromRSAPrivateKey ((RSA)value);
209
210
211
0 commit comments