internal byte[] Encrypt(byte[] data) { // NET45 should have been passed RsaCryptoServiceProvider, EncryptValue may fail // We don't have 'lightup' for decryption / encryption. #if NET45 if (RsaCryptoServiceProviderProxy != null) { return(RsaCryptoServiceProviderProxy.Encrypt(data, _useRSAOeapPadding)); } else { return(RSA.EncryptValue(data)); } #endif // NET461 could have been passed RSACryptoServiceProvider #if NET461 if (RsaCryptoServiceProviderProxy != null) { return(RsaCryptoServiceProviderProxy.Encrypt(data, _useRSAOeapPadding)); } return(RSA.Encrypt(data, _rsaEncryptionPadding)); #endif // NETSTANDARD2_0 doesn't use RSACryptoServiceProviderProxy #if NETSTANDARD2_0 return(RSA.Encrypt(data, _rsaEncryptionPadding)); #endif }
internal byte[] EncryptWithRsaCryptoServiceProviderProxy(byte[] bytes) { return(RsaCryptoServiceProviderProxy.Encrypt(bytes, _useRSAOeapPadding)); }