Updates referencesource to .NET 4.7
[mono.git] / mcs / class / referencesource / System.IdentityModel / System / IdentityModel / Claims / X509CertificateClaimSet.cs
index 7561fffb97fc10cc47b715f422fee4b0ce0a6a15..cf6bf7762e7f480ef04fa5120a849a4ebc7035b0 100644 (file)
@@ -192,7 +192,15 @@ namespace System.IdentityModel.Claims
             if (!string.IsNullOrEmpty(value))
                 claims.Add(Claim.CreateUriClaim(new Uri(value)));
 
-            RSA rsa = this.certificate.PublicKey.Key as RSA;
+            RSA rsa;
+            if (LocalAppContextSwitches.DisableCngCertificates)
+            {
+                rsa = this.certificate.PublicKey.Key as RSA;
+            }
+            else
+            {
+                rsa = CngLightup.GetRSAPublicKey(this.certificate);
+            }
             if (rsa != null)
                 claims.Add(Claim.CreateRsaClaim(rsa));