@@ -40,26 +40,26 @@ public void CsfleSchemaBuilder_works_as_expected()
40
40
builder
41
41
. EncryptMetadata ( keyId : _keyId )
42
42
. Property ( p => p . MedicalRecords , BsonType . Array ,
43
- CsfleEncryptionAlgorithm . AEAD_AES_256_CBC_HMAC_SHA_512_Random )
43
+ EncryptionAlgorithm . AEAD_AES_256_CBC_HMAC_SHA_512_Random )
44
44
. Property ( "bloodType" , BsonType . String ,
45
- algorithm : CsfleEncryptionAlgorithm . AEAD_AES_256_CBC_HMAC_SHA_512_Random )
45
+ algorithm : EncryptionAlgorithm . AEAD_AES_256_CBC_HMAC_SHA_512_Random )
46
46
. Property ( p => p . Ssn , BsonType . Int32 ,
47
- CsfleEncryptionAlgorithm . AEAD_AES_256_CBC_HMAC_SHA_512_Deterministic )
47
+ EncryptionAlgorithm . AEAD_AES_256_CBC_HMAC_SHA_512_Deterministic )
48
48
. Property ( p => p . Insurance , innerBuilder =>
49
49
{
50
50
innerBuilder
51
51
. Property ( i => i . PolicyNumber , BsonType . Int32 ,
52
- CsfleEncryptionAlgorithm . AEAD_AES_256_CBC_HMAC_SHA_512_Deterministic ) ;
52
+ EncryptionAlgorithm . AEAD_AES_256_CBC_HMAC_SHA_512_Deterministic ) ;
53
53
} )
54
- . PatternProperty ( "_PIIString$" , BsonType . String , CsfleEncryptionAlgorithm . AEAD_AES_256_CBC_HMAC_SHA_512_Deterministic )
55
- . PatternProperty ( "_PIIArray$" , BsonType . Array , CsfleEncryptionAlgorithm . AEAD_AES_256_CBC_HMAC_SHA_512_Random )
54
+ . PatternProperty ( "_PIIString$" , BsonType . String , EncryptionAlgorithm . AEAD_AES_256_CBC_HMAC_SHA_512_Deterministic )
55
+ . PatternProperty ( "_PIIArray$" , BsonType . Array , EncryptionAlgorithm . AEAD_AES_256_CBC_HMAC_SHA_512_Random )
56
56
. PatternProperty ( p => p . Insurance , innerBuilder =>
57
57
{
58
58
innerBuilder
59
59
. PatternProperty ( "_PIIString$" , BsonType . String ,
60
- CsfleEncryptionAlgorithm . AEAD_AES_256_CBC_HMAC_SHA_512_Deterministic )
60
+ EncryptionAlgorithm . AEAD_AES_256_CBC_HMAC_SHA_512_Deterministic )
61
61
. PatternProperty ( "_PIINumber$" , BsonType . Int32 ,
62
- algorithm : CsfleEncryptionAlgorithm . AEAD_AES_256_CBC_HMAC_SHA_512_Deterministic ) ;
62
+ algorithm : EncryptionAlgorithm . AEAD_AES_256_CBC_HMAC_SHA_512_Deterministic ) ;
63
63
} ) ;
64
64
65
65
} ) ;
@@ -155,7 +155,7 @@ public void CsfleSchemaBuilder_WithMultipleTypes_works_as_expected()
155
155
builder
156
156
. EncryptMetadata ( keyId : _keyId )
157
157
. Property ( p => p . MedicalRecords , BsonType . Array ,
158
- CsfleEncryptionAlgorithm . AEAD_AES_256_CBC_HMAC_SHA_512_Random ) ;
158
+ EncryptionAlgorithm . AEAD_AES_256_CBC_HMAC_SHA_512_Random ) ;
159
159
} ) ;
160
160
161
161
schemaBuilder . Encrypt < TestClass > ( testClassCollectionName , builder =>
@@ -201,14 +201,14 @@ public void CsfleSchemaBuilder_WithMultipleTypes_works_as_expected()
201
201
202
202
[ Theory ]
203
203
[ InlineData (
204
- CsfleEncryptionAlgorithm . AEAD_AES_256_CBC_HMAC_SHA_512_Random ,
204
+ EncryptionAlgorithm . AEAD_AES_256_CBC_HMAC_SHA_512_Random ,
205
205
null ,
206
206
""" "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" """ ) ]
207
207
[ InlineData (
208
208
null ,
209
209
_keyIdString ,
210
210
""" "keyId": [{ "$binary" : { "base64" : "b0r0cADRQB+sOfRZAqDAyA==", "subType" : "04" } }] """ ) ]
211
- public void EncryptedCollection_Metadata_works_as_expected ( CsfleEncryptionAlgorithm ? algorithm , string keyString , string expectedContent )
211
+ public void EncryptedCollection_Metadata_works_as_expected ( EncryptionAlgorithm ? algorithm , string keyString , string expectedContent )
212
212
{
213
213
Guid ? keyId = keyString is null ? null : Guid . Parse ( keyString ) ;
214
214
var builder = new EncryptedCollectionBuilder < Patient > ( ) ;
@@ -229,18 +229,18 @@ public void EncryptedCollection_Metadata_works_as_expected(CsfleEncryptionAlgori
229
229
230
230
[ Theory ]
231
231
[ InlineData ( BsonType . Array ,
232
- CsfleEncryptionAlgorithm . AEAD_AES_256_CBC_HMAC_SHA_512_Random ,
232
+ EncryptionAlgorithm . AEAD_AES_256_CBC_HMAC_SHA_512_Random ,
233
233
null ,
234
234
""" "bsonType": "array", "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" """ ) ]
235
235
[ InlineData ( BsonType . Array ,
236
236
null ,
237
237
_keyIdString ,
238
238
""" "bsonType": "array", "keyId": [{ "$binary" : { "base64" : "b0r0cADRQB+sOfRZAqDAyA==", "subType" : "04" } }] """ ) ]
239
239
[ InlineData ( BsonType . Array ,
240
- CsfleEncryptionAlgorithm . AEAD_AES_256_CBC_HMAC_SHA_512_Random ,
240
+ EncryptionAlgorithm . AEAD_AES_256_CBC_HMAC_SHA_512_Random ,
241
241
_keyIdString ,
242
242
""" "bsonType": "array", "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", "keyId": [{ "$binary" : { "base64" : "b0r0cADRQB+sOfRZAqDAyA==", "subType" : "04" } }] """ ) ]
243
- public void EncryptedCollection_PatternProperty_works_as_expected ( BsonType bsonType , CsfleEncryptionAlgorithm ? algorithm , string keyString , string expectedContent )
243
+ public void EncryptedCollection_PatternProperty_works_as_expected ( BsonType bsonType , EncryptionAlgorithm ? algorithm , string keyString , string expectedContent )
244
244
{
245
245
Guid ? keyId = keyString is null ? null : Guid . Parse ( keyString ) ;
246
246
var builder = new EncryptedCollectionBuilder < Patient > ( ) ;
@@ -265,18 +265,18 @@ public void EncryptedCollection_PatternProperty_works_as_expected(BsonType bsonT
265
265
266
266
[ Theory ]
267
267
[ InlineData ( new [ ] { BsonType . Array , BsonType . String } ,
268
- CsfleEncryptionAlgorithm . AEAD_AES_256_CBC_HMAC_SHA_512_Random ,
268
+ EncryptionAlgorithm . AEAD_AES_256_CBC_HMAC_SHA_512_Random ,
269
269
null ,
270
270
""" "bsonType": ["array", "string"], "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" """ ) ]
271
271
[ InlineData ( new [ ] { BsonType . Array , BsonType . String } ,
272
272
null ,
273
273
_keyIdString ,
274
274
""" "bsonType": ["array", "string"], "keyId": [{ "$binary" : { "base64" : "b0r0cADRQB+sOfRZAqDAyA==", "subType" : "04" } }] """ ) ]
275
275
[ InlineData ( new [ ] { BsonType . Array , BsonType . String } ,
276
- CsfleEncryptionAlgorithm . AEAD_AES_256_CBC_HMAC_SHA_512_Random ,
276
+ EncryptionAlgorithm . AEAD_AES_256_CBC_HMAC_SHA_512_Random ,
277
277
_keyIdString ,
278
278
""" "bsonType": ["array", "string"], "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", "keyId": [{ "$binary" : { "base64" : "b0r0cADRQB+sOfRZAqDAyA==", "subType" : "04" } }] """ ) ]
279
- public void EncryptedCollection_PatternPropertyWithMultipleBsonTypes_works_as_expected ( IEnumerable < BsonType > bsonTypes , CsfleEncryptionAlgorithm ? algorithm , string keyString , string expectedContent )
279
+ public void EncryptedCollection_PatternPropertyWithMultipleBsonTypes_works_as_expected ( IEnumerable < BsonType > bsonTypes , EncryptionAlgorithm ? algorithm , string keyString , string expectedContent )
280
280
{
281
281
Guid ? keyId = keyString is null ? null : Guid . Parse ( keyString ) ;
282
282
var builder = new EncryptedCollectionBuilder < Patient > ( ) ;
@@ -310,9 +310,9 @@ public void EncryptedCollection_PatternPropertyNested_works_as_expected()
310
310
innerBuilder
311
311
. EncryptMetadata ( keyId )
312
312
. Property ( "policyNumber" , BsonType . Int32 ,
313
- CsfleEncryptionAlgorithm . AEAD_AES_256_CBC_HMAC_SHA_512_Deterministic )
313
+ EncryptionAlgorithm . AEAD_AES_256_CBC_HMAC_SHA_512_Deterministic )
314
314
. PatternProperty ( "randomRegex*" , BsonType . String ,
315
- CsfleEncryptionAlgorithm . AEAD_AES_256_CBC_HMAC_SHA_512_Random ) ;
315
+ EncryptionAlgorithm . AEAD_AES_256_CBC_HMAC_SHA_512_Random ) ;
316
316
} ) ;
317
317
318
318
var expected = """
@@ -359,9 +359,9 @@ public void EncryptedCollection_PatternPropertyNestedWithString_works_as_expecte
359
359
innerBuilder
360
360
. EncryptMetadata ( keyId )
361
361
. Property ( "policyNumber" , BsonType . Int32 ,
362
- CsfleEncryptionAlgorithm . AEAD_AES_256_CBC_HMAC_SHA_512_Deterministic )
362
+ EncryptionAlgorithm . AEAD_AES_256_CBC_HMAC_SHA_512_Deterministic )
363
363
. PatternProperty ( "randomRegex*" , BsonType . String ,
364
- CsfleEncryptionAlgorithm . AEAD_AES_256_CBC_HMAC_SHA_512_Random ) ;
364
+ EncryptionAlgorithm . AEAD_AES_256_CBC_HMAC_SHA_512_Random ) ;
365
365
} ) ;
366
366
367
367
var expected = """
@@ -399,18 +399,18 @@ public void EncryptedCollection_PatternPropertyNestedWithString_works_as_expecte
399
399
400
400
[ Theory ]
401
401
[ InlineData ( BsonType . Array ,
402
- CsfleEncryptionAlgorithm . AEAD_AES_256_CBC_HMAC_SHA_512_Random ,
402
+ EncryptionAlgorithm . AEAD_AES_256_CBC_HMAC_SHA_512_Random ,
403
403
null ,
404
404
""" "bsonType": "array", "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" """ ) ]
405
405
[ InlineData ( BsonType . Array ,
406
406
null ,
407
407
_keyIdString ,
408
408
""" "bsonType": "array", "keyId": [{ "$binary" : { "base64" : "b0r0cADRQB+sOfRZAqDAyA==", "subType" : "04" } }] """ ) ]
409
409
[ InlineData ( BsonType . Array ,
410
- CsfleEncryptionAlgorithm . AEAD_AES_256_CBC_HMAC_SHA_512_Random ,
410
+ EncryptionAlgorithm . AEAD_AES_256_CBC_HMAC_SHA_512_Random ,
411
411
_keyIdString ,
412
412
""" "bsonType": "array", "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", "keyId": [{ "$binary" : { "base64" : "b0r0cADRQB+sOfRZAqDAyA==", "subType" : "04" } }] """ ) ]
413
- public void EncryptedCollection_PropertyWithExpression_works_as_expected ( BsonType bsonType , CsfleEncryptionAlgorithm ? algorithm , string keyString , string expectedContent )
413
+ public void EncryptedCollection_PropertyWithExpression_works_as_expected ( BsonType bsonType , EncryptionAlgorithm ? algorithm , string keyString , string expectedContent )
414
414
{
415
415
Guid ? keyId = keyString is null ? null : Guid . Parse ( keyString ) ;
416
416
var builder = new EncryptedCollectionBuilder < Patient > ( ) ;
@@ -435,18 +435,18 @@ public void EncryptedCollection_PropertyWithExpression_works_as_expected(BsonTyp
435
435
436
436
[ Theory ]
437
437
[ InlineData ( new [ ] { BsonType . Array , BsonType . String } ,
438
- CsfleEncryptionAlgorithm . AEAD_AES_256_CBC_HMAC_SHA_512_Random ,
438
+ EncryptionAlgorithm . AEAD_AES_256_CBC_HMAC_SHA_512_Random ,
439
439
null ,
440
440
""" "bsonType": ["array", "string"], "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" """ ) ]
441
441
[ InlineData ( new [ ] { BsonType . Array , BsonType . String } ,
442
442
null ,
443
443
_keyIdString ,
444
444
""" "bsonType": ["array", "string"], "keyId": [{ "$binary" : { "base64" : "b0r0cADRQB+sOfRZAqDAyA==", "subType" : "04" } }] """ ) ]
445
445
[ InlineData ( new [ ] { BsonType . Array , BsonType . String } ,
446
- CsfleEncryptionAlgorithm . AEAD_AES_256_CBC_HMAC_SHA_512_Random ,
446
+ EncryptionAlgorithm . AEAD_AES_256_CBC_HMAC_SHA_512_Random ,
447
447
_keyIdString ,
448
448
""" "bsonType": ["array", "string"], "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", "keyId": [{ "$binary" : { "base64" : "b0r0cADRQB+sOfRZAqDAyA==", "subType" : "04" } }] """ ) ]
449
- public void EncryptedCollection_PropertyWithMultipleBsonTypes_works_as_expected ( IEnumerable < BsonType > bsonTypes , CsfleEncryptionAlgorithm ? algorithm , string keyString , string expectedContent )
449
+ public void EncryptedCollection_PropertyWithMultipleBsonTypes_works_as_expected ( IEnumerable < BsonType > bsonTypes , EncryptionAlgorithm ? algorithm , string keyString , string expectedContent )
450
450
{
451
451
Guid ? keyId = keyString is null ? null : Guid . Parse ( keyString ) ;
452
452
var builder = new EncryptedCollectionBuilder < Patient > ( ) ;
@@ -471,18 +471,18 @@ public void EncryptedCollection_PropertyWithMultipleBsonTypes_works_as_expected(
471
471
472
472
[ Theory ]
473
473
[ InlineData ( BsonType . Array ,
474
- CsfleEncryptionAlgorithm . AEAD_AES_256_CBC_HMAC_SHA_512_Random ,
474
+ EncryptionAlgorithm . AEAD_AES_256_CBC_HMAC_SHA_512_Random ,
475
475
null ,
476
476
""" "bsonType": "array", "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" """ ) ]
477
477
[ InlineData ( BsonType . Array ,
478
478
null ,
479
479
_keyIdString ,
480
480
""" "bsonType": "array", "keyId": [{ "$binary" : { "base64" : "b0r0cADRQB+sOfRZAqDAyA==", "subType" : "04" } }] """ ) ]
481
481
[ InlineData ( BsonType . Array ,
482
- CsfleEncryptionAlgorithm . AEAD_AES_256_CBC_HMAC_SHA_512_Random ,
482
+ EncryptionAlgorithm . AEAD_AES_256_CBC_HMAC_SHA_512_Random ,
483
483
_keyIdString ,
484
484
""" "bsonType": "array", "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", "keyId": [{ "$binary" : { "base64" : "b0r0cADRQB+sOfRZAqDAyA==", "subType" : "04" } }] """ ) ]
485
- public void EncryptedCollection_PropertyWithString_works_as_expected ( BsonType bsonType , CsfleEncryptionAlgorithm ? algorithm , string keyString , string expectedContent )
485
+ public void EncryptedCollection_PropertyWithString_works_as_expected ( BsonType bsonType , EncryptionAlgorithm ? algorithm , string keyString , string expectedContent )
486
486
{
487
487
Guid ? keyId = keyString is null ? null : Guid . Parse ( keyString ) ;
488
488
var builder = new EncryptedCollectionBuilder < Patient > ( ) ;
@@ -516,9 +516,9 @@ public void EncryptedCollection_PropertyNested_works_as_expected()
516
516
innerBuilder
517
517
. EncryptMetadata ( keyId )
518
518
. Property ( "policyNumber" , BsonType . Int32 ,
519
- CsfleEncryptionAlgorithm . AEAD_AES_256_CBC_HMAC_SHA_512_Deterministic )
519
+ EncryptionAlgorithm . AEAD_AES_256_CBC_HMAC_SHA_512_Deterministic )
520
520
. PatternProperty ( "randomRegex*" , BsonType . String ,
521
- CsfleEncryptionAlgorithm . AEAD_AES_256_CBC_HMAC_SHA_512_Random ) ;
521
+ EncryptionAlgorithm . AEAD_AES_256_CBC_HMAC_SHA_512_Random ) ;
522
522
} ) ;
523
523
524
524
var expected = """
@@ -565,9 +565,9 @@ public void EncryptedCollection_PropertyNestedWithString_works_as_expected()
565
565
innerBuilder
566
566
. EncryptMetadata ( keyId )
567
567
. Property ( "policyNumber" , BsonType . Int32 ,
568
- CsfleEncryptionAlgorithm . AEAD_AES_256_CBC_HMAC_SHA_512_Deterministic )
568
+ EncryptionAlgorithm . AEAD_AES_256_CBC_HMAC_SHA_512_Deterministic )
569
569
. PatternProperty ( "randomRegex*" , BsonType . String ,
570
- CsfleEncryptionAlgorithm . AEAD_AES_256_CBC_HMAC_SHA_512_Random ) ;
570
+ EncryptionAlgorithm . AEAD_AES_256_CBC_HMAC_SHA_512_Random ) ;
571
571
} ) ;
572
572
573
573
var expected = """
0 commit comments