@@ -157,57 +157,6 @@ public void TestRoundTripWithCSPAndCertStoreProvider()
157
157
}
158
158
}
159
159
160
- [ ConditionalTheory ( typeof ( DataTestUtility ) , nameof ( DataTestUtility . AreConnStringSetupForAE ) ) ]
161
- [ ClassData ( typeof ( AEConnectionStringProvider ) ) ]
162
- public void TestEncryptDecryptWithCSP ( string connectionString )
163
- {
164
- string providerName = @"Microsoft Enhanced RSA and AES Cryptographic Provider" ;
165
- string keyIdentifier = DataTestUtility . GetLongName ( "CSP" ) ;
166
- CspParameters namedCspParameters = new CspParameters ( providerType , providerName , keyIdentifier ) ;
167
- using SQLSetupStrategyCspProvider sqlSetupStrategyCsp = new SQLSetupStrategyCspProvider ( namedCspParameters ) ;
168
-
169
- try
170
- {
171
- CertificateUtilityWin . RSAPersistKeyInCsp ( providerName , keyIdentifier ) ;
172
- string cspPath = String . Concat ( providerName , @"/" , keyIdentifier ) ;
173
-
174
- SQLSetupStrategyCspExt sqlSetupStrategyCsp = new SQLSetupStrategyCspExt ( cspPath ) ;
175
- string tableName = sqlSetupStrategyCsp . CspProviderTable . Name ;
176
-
177
- try
178
- {
179
- using SqlConnection sqlConn = new ( connectionString ) ;
180
- sqlConn . Open ( ) ;
181
-
182
- Table . DeleteData ( tableName , sqlConn ) ;
183
-
184
- // insert 1 row data
185
- Customer customer = new Customer ( 45 , "Microsoft" , "Corporation" ) ;
186
-
187
- DatabaseHelper . InsertCustomerData ( sqlConn , null , tableName , customer ) ;
188
-
189
- // Test INPUT parameter on an encrypted parameter
190
- using SqlCommand sqlCommand = new ( @$ "SELECT CustomerId, FirstName, LastName FROM [{ tableName } ] WHERE FirstName = @firstName",
191
- sqlConn , null , SqlCommandColumnEncryptionSetting . Enabled ) ;
192
- SqlParameter customerFirstParam = sqlCommand . Parameters . AddWithValue ( @"firstName" , @"Microsoft" ) ;
193
- Console . WriteLine ( @"Exception: {0}" ) ;
194
- customerFirstParam . Direction = System . Data . ParameterDirection . Input ;
195
-
196
- using SqlDataReader sqlDataReader = sqlCommand . ExecuteReader ( ) ;
197
- ValidateResultSet ( sqlDataReader ) ;
198
- }
199
- finally
200
- {
201
- // clean up database resources
202
- sqlSetupStrategyCsp . Dispose ( ) ;
203
- }
204
- }
205
- finally
206
- {
207
- CertificateUtilityWin . RSADeleteKeyInCsp ( providerName , keyIdentifier ) ;
208
- }
209
- }
210
-
211
160
/// <summary>
212
161
/// Validates that the results are the ones expected.
213
162
/// </summary>
0 commit comments