public static byte[] SignData(this RSA rsa, byte[] bytes, string hashAlgorithm) { #if !NETSTANDARD1_6 return ((RSACryptoServiceProvider)rsa).SignData(bytes, hashAlgorithm); #else return rsa.SignData(bytes, ToHashAlgorithmName(hashAlgorithm), RSASignaturePadding.Pkcs1); #endif }