Beispiel #1
0
        internal byte[] Decrypt(byte[] data)
        {
            // NET45 should have been passed RsaCryptoServiceProvider, DecryptValue may fail
            // We don't have 'lightup' for decryption / encryption.
#if NET45
            if (RsaCryptoServiceProviderProxy != null)
            {
                return(RsaCryptoServiceProviderProxy.Decrypt(data, _useRSAOeapPadding));
            }
            else
            {
                return(RSA.DecryptValue(data));
            }
#endif

            // NET461 could have been passed RSACryptoServiceProvider
#if NET461
            if (RsaCryptoServiceProviderProxy != null)
            {
                return(RsaCryptoServiceProviderProxy.Decrypt(data, _useRSAOeapPadding));
            }
            else
            {
                return(RSA.Decrypt(data, _rsaEncryptionPadding));
            }
#endif

            // NETSTANDARD2_0 doesn't use RSACryptoServiceProviderProxy
#if NETSTANDARD2_0
            return(RSA.Decrypt(data, _rsaEncryptionPadding));
#endif
        }
 internal byte[] DecryptWithRsaCryptoServiceProviderProxy(byte[] bytes)
 {
     return(RsaCryptoServiceProviderProxy.Decrypt(bytes, _useRSAOeapPadding));
 }