public static byte[] Encrypt(this RSA rsa, byte[] bytes) { #if !NETSTANDARD1_6 return ((RSACryptoServiceProvider)rsa).Encrypt(bytes, RsaUtils.DoOAEPPadding); #else return rsa.Encrypt(bytes, RSAEncryptionPadding.OaepSHA1); #endif }