@@ -395,7 +395,7 @@ public static class PlatformRsaUtils
395395 {
396396 public static void FromXml ( this RSA rsa , string xml )
397397 {
398- #if ! NETSTANDARD2_0
398+ #if ! NETCORE
399399 rsa . FromXmlString ( xml ) ;
400400#else
401401 //Throws PlatformNotSupportedException
@@ -406,15 +406,15 @@ public static void FromXml(this RSA rsa, string xml)
406406
407407 public static string ToXml ( this RSA rsa , bool includePrivateParameters )
408408 {
409- #if ! NETSTANDARD2_0
409+ #if ! NETCORE
410410 return rsa . ToXmlString ( includePrivateParameters : includePrivateParameters ) ;
411411#else
412412 //Throws PlatformNotSupportedException
413413 return ExportToXml ( rsa . ExportParameters ( includePrivateParameters ) , includePrivateParameters ) ;
414414#endif
415415 }
416416
417- #if NETSTANDARD2_0
417+ #if NETCORE
418418 public static HashAlgorithmName ToHashAlgorithmName ( string hashAlgorithm )
419419 {
420420 return hashAlgorithm . ToUpper ( ) switch {
@@ -430,7 +430,7 @@ public static HashAlgorithmName ToHashAlgorithmName(string hashAlgorithm)
430430
431431 public static byte [ ] Encrypt ( this RSA rsa , byte [ ] bytes )
432432 {
433- #if ! NETSTANDARD2_0
433+ #if ! NETCORE
434434 return ( ( RSACryptoServiceProvider ) rsa ) . Encrypt ( bytes , RsaUtils . DoOAEPPadding ) ;
435435#else
436436 return rsa . Encrypt ( bytes , RSAEncryptionPadding . OaepSHA1 ) ;
@@ -439,7 +439,7 @@ public static byte[] Encrypt(this RSA rsa, byte[] bytes)
439439
440440 public static byte [ ] Decrypt ( this RSA rsa , byte [ ] bytes )
441441 {
442- #if ! NETSTANDARD2_0
442+ #if ! NETCORE
443443 return ( ( RSACryptoServiceProvider ) rsa ) . Decrypt ( bytes , RsaUtils . DoOAEPPadding ) ;
444444#else
445445 return rsa . Decrypt ( bytes , RSAEncryptionPadding . OaepSHA1 ) ;
@@ -448,7 +448,7 @@ public static byte[] Decrypt(this RSA rsa, byte[] bytes)
448448
449449 public static byte [ ] SignData ( this RSA rsa , byte [ ] bytes , string hashAlgorithm )
450450 {
451- #if ! NETSTANDARD2_0
451+ #if ! NETCORE
452452 return ( ( RSACryptoServiceProvider ) rsa ) . SignData ( bytes , hashAlgorithm ) ;
453453#else
454454 return rsa . SignData ( bytes , ToHashAlgorithmName ( hashAlgorithm ) , RSASignaturePadding . Pkcs1 ) ;
@@ -457,7 +457,7 @@ public static byte[] SignData(this RSA rsa, byte[] bytes, string hashAlgorithm)
457457
458458 public static bool VerifyData ( this RSA rsa , byte [ ] bytes , byte [ ] signature , string hashAlgorithm )
459459 {
460- #if ! NETSTANDARD2_0
460+ #if ! NETCORE
461461 return ( ( RSACryptoServiceProvider ) rsa ) . VerifyData ( bytes , hashAlgorithm , signature ) ;
462462#else
463463 return rsa . VerifyData ( bytes , signature , ToHashAlgorithmName ( hashAlgorithm ) , RSASignaturePadding . Pkcs1 ) ;
0 commit comments