@@ -238,8 +238,8 @@ public async Task AuthenticateAsyncWithDeviceCAX509InScopeCacheSucceeds()
238
238
{
239
239
var notBefore = DateTime . Now . Subtract ( TimeSpan . FromDays ( 2 ) ) ;
240
240
var notAfter = DateTime . Now . AddYears ( 1 ) ;
241
- var ( caCert , caKeyPair ) = TestCertificateHelper . GenerateSelfSignedCert ( "MyTestCA" , notBefore , notAfter , true ) ;
242
- var ( issuedClientCert , issuedClientKeyPair ) = TestCertificateHelper . GenerateCertificate ( "MyIssuedTestClient" , notBefore , notAfter , caCert , caKeyPair , false , null , null ) ;
241
+ var caCert = TestCertificateHelper . GenerateSelfSignedCert ( "MyTestCA" , notBefore , notAfter , true ) ;
242
+ var issuedClientCert = TestCertificateHelper . GenerateCertificate ( "MyIssuedTestClient" , notBefore , notAfter , caCert , false , null , null ) ;
243
243
IList < X509Certificate2 > issuedClientCertChain = new List < X509Certificate2 > ( ) { caCert } ;
244
244
IList < X509Certificate2 > trustBundle = new List < X509Certificate2 > ( ) { caCert } ;
245
245
string deviceId = "MyIssuedTestClient" ;
@@ -269,8 +269,8 @@ public async Task AuthenticateAsyncWithDeviceCAX509NotInScopeCacheFails()
269
269
{
270
270
var notBefore = DateTime . Now . Subtract ( TimeSpan . FromDays ( 2 ) ) ;
271
271
var notAfter = DateTime . Now . AddYears ( 1 ) ;
272
- var ( caCert , caKeyPair ) = TestCertificateHelper . GenerateSelfSignedCert ( "MyTestCA" , notBefore , notAfter , true ) ;
273
- var ( issuedClientCert , issuedClientKeyPair ) = TestCertificateHelper . GenerateCertificate ( "MyIssuedTestClient" , notBefore , notAfter , caCert , caKeyPair , false , null , null ) ;
272
+ var caCert = TestCertificateHelper . GenerateSelfSignedCert ( "MyTestCA" , notBefore , notAfter , true ) ;
273
+ var issuedClientCert = TestCertificateHelper . GenerateCertificate ( "MyIssuedTestClient" , notBefore , notAfter , caCert , false , null , null ) ;
274
274
IList < X509Certificate2 > issuedClientCertChain = new List < X509Certificate2 > ( ) { caCert } ;
275
275
IList < X509Certificate2 > trustBundle = new List < X509Certificate2 > ( ) { caCert } ;
276
276
string deviceId = "MyIssuedTestClient" ;
@@ -300,8 +300,8 @@ public async Task AuthenticateAsyncWithDeviceCAX509ExpiredCertInScopeCacheFails(
300
300
{
301
301
var notBefore = DateTime . Now . Subtract ( TimeSpan . FromDays ( 2 ) ) ;
302
302
var notAfter = DateTime . Now . Subtract ( TimeSpan . FromDays ( 1 ) ) ;
303
- var ( caCert , caKeyPair ) = TestCertificateHelper . GenerateSelfSignedCert ( "MyTestCA" , notBefore , notAfter , true ) ;
304
- var ( issuedClientCert , issuedClientKeyPair ) = TestCertificateHelper . GenerateCertificate ( "MyIssuedTestClient" , notBefore , notAfter , caCert , caKeyPair , false , null , null ) ;
303
+ var caCert = TestCertificateHelper . GenerateSelfSignedCert ( "MyTestCA" , notBefore , notAfter , true ) ;
304
+ var issuedClientCert = TestCertificateHelper . GenerateCertificate ( "MyIssuedTestClient" , notBefore , notAfter , caCert , false , null , null ) ;
305
305
IList < X509Certificate2 > issuedClientCertChain = new List < X509Certificate2 > ( ) { caCert } ;
306
306
IList < X509Certificate2 > trustBundle = new List < X509Certificate2 > ( ) { caCert } ;
307
307
string deviceId = "MyIssuedTestClient" ;
@@ -331,8 +331,8 @@ public async Task AuthenticateAsyncWithDeviceCAX509FutureValidCertInScopeCacheFa
331
331
var notBefore = DateTime . Now . AddYears ( 1 ) ;
332
332
var notAfter = DateTime . Now . AddYears ( 2 ) ;
333
333
334
- var ( caCert , caKeyPair ) = TestCertificateHelper . GenerateSelfSignedCert ( "MyTestCA" , notBefore , notAfter , true ) ;
335
- var ( issuedClientCert , issuedClientKeyPair ) = TestCertificateHelper . GenerateCertificate ( "MyIssuedTestClient" , notBefore , notAfter , caCert , caKeyPair , false , null , null ) ;
334
+ var caCert = TestCertificateHelper . GenerateSelfSignedCert ( "MyTestCA" , notBefore , notAfter , true ) ;
335
+ var issuedClientCert = TestCertificateHelper . GenerateCertificate ( "MyIssuedTestClient" , notBefore , notAfter , caCert , false , null , null ) ;
336
336
IList < X509Certificate2 > issuedClientCertChain = new List < X509Certificate2 > ( ) { caCert } ;
337
337
IList < X509Certificate2 > trustBundle = new List < X509Certificate2 > ( ) { caCert } ;
338
338
string deviceId = "MyIssuedTestClient" ;
@@ -362,8 +362,8 @@ public async Task AuthenticateAsyncWithDeviceCAX509CATrueInScopeCacheFails()
362
362
var notBefore = DateTime . Now . Subtract ( TimeSpan . FromDays ( 2 ) ) ;
363
363
var notAfter = DateTime . Now . AddYears ( 1 ) ;
364
364
365
- var ( caCert , caKeyPair ) = TestCertificateHelper . GenerateSelfSignedCert ( "MyTestCA" , notBefore , notAfter , true ) ;
366
- var ( issuedClientCert , issuedClientKeyPair ) = TestCertificateHelper . GenerateCertificate ( "MyIssuedTestClient" , notBefore , notAfter , caCert , caKeyPair , true , null , null ) ;
365
+ var caCert = TestCertificateHelper . GenerateSelfSignedCert ( "MyTestCA" , notBefore , notAfter , true ) ;
366
+ var issuedClientCert = TestCertificateHelper . GenerateCertificate ( "MyIssuedTestClient" , notBefore , notAfter , caCert , true , null , null ) ;
367
367
IList < X509Certificate2 > issuedClientCertChain = new List < X509Certificate2 > ( ) { caCert } ;
368
368
IList < X509Certificate2 > trustBundle = new List < X509Certificate2 > ( ) { caCert } ;
369
369
string deviceId = "MyIssuedTestClient" ;
@@ -392,8 +392,8 @@ public async Task AuthenticateAsyncWithMismatchDeviceIDCAX509InScopeCacheFails()
392
392
{
393
393
var notBefore = DateTime . Now . Subtract ( TimeSpan . FromDays ( 2 ) ) ;
394
394
var notAfter = DateTime . Now . AddYears ( 1 ) ;
395
- var ( caCert , caKeyPair ) = TestCertificateHelper . GenerateSelfSignedCert ( "MyTestCA" , notBefore , notAfter , true ) ;
396
- var ( issuedClientCert , issuedClientKeyPair ) = TestCertificateHelper . GenerateCertificate ( "MyIssuedTestClient" , notBefore , notAfter , caCert , caKeyPair , false , null , null ) ;
395
+ var caCert = TestCertificateHelper . GenerateSelfSignedCert ( "MyTestCA" , notBefore , notAfter , true ) ;
396
+ var issuedClientCert = TestCertificateHelper . GenerateCertificate ( "MyIssuedTestClient" , notBefore , notAfter , caCert , false , null , null ) ;
397
397
IList < X509Certificate2 > issuedClientCertChain = new List < X509Certificate2 > ( ) { caCert } ;
398
398
IList < X509Certificate2 > trustBundle = new List < X509Certificate2 > ( ) { caCert } ;
399
399
string deviceId = "different from CN" ;
@@ -422,8 +422,8 @@ public async Task AuthenticateAsyncWithEmptyChainDeviceCAX509InScopeCacheFails()
422
422
{
423
423
var notBefore = DateTime . Now . Subtract ( TimeSpan . FromDays ( 2 ) ) ;
424
424
var notAfter = DateTime . Now . AddYears ( 1 ) ;
425
- var ( caCert , caKeyPair ) = TestCertificateHelper . GenerateSelfSignedCert ( "MyTestCA" , notBefore , notAfter , true ) ;
426
- var ( issuedClientCert , issuedClientKeyPair ) = TestCertificateHelper . GenerateCertificate ( "MyIssuedTestClient" , notBefore , notAfter , caCert , caKeyPair , false , null , null ) ;
425
+ var caCert = TestCertificateHelper . GenerateSelfSignedCert ( "MyTestCA" , notBefore , notAfter , true ) ;
426
+ var issuedClientCert = TestCertificateHelper . GenerateCertificate ( "MyIssuedTestClient" , notBefore , notAfter , caCert , false , null , null ) ;
427
427
IList < X509Certificate2 > issuedClientCertChain = new List < X509Certificate2 > ( ) { } ; // empty chain supplied
428
428
IList < X509Certificate2 > trustBundle = new List < X509Certificate2 > ( ) { caCert } ;
429
429
string deviceId = "different from CN" ;
@@ -452,9 +452,9 @@ public async Task AuthenticateAsyncWithInvalidChainDeviceCAX509InScopeCacheFails
452
452
{
453
453
var notBefore = DateTime . Now . Subtract ( TimeSpan . FromDays ( 2 ) ) ;
454
454
var notAfter = DateTime . Now . AddYears ( 1 ) ;
455
- var ( caCert , caKeyPair ) = TestCertificateHelper . GenerateSelfSignedCert ( "MyTestCA" , notBefore , notAfter , true ) ;
456
- var ( otherCaCert , otherCaKeyPair ) = TestCertificateHelper . GenerateSelfSignedCert ( "MyOtherTestCA" , notBefore , notAfter , true ) ;
457
- var ( issuedClientCert , issuedClientKeyPair ) = TestCertificateHelper . GenerateCertificate ( "MyIssuedTestClient" , notBefore , notAfter , caCert , caKeyPair , false , null , null ) ;
455
+ var caCert = TestCertificateHelper . GenerateSelfSignedCert ( "MyTestCA" , notBefore , notAfter , true ) ;
456
+ var otherCaCert = TestCertificateHelper . GenerateSelfSignedCert ( "MyOtherTestCA" , notBefore , notAfter , true ) ;
457
+ var issuedClientCert = TestCertificateHelper . GenerateCertificate ( "MyIssuedTestClient" , notBefore , notAfter , caCert , false , null , null ) ;
458
458
IList < X509Certificate2 > issuedClientCertChain = new List < X509Certificate2 > ( ) { otherCaCert } ; // invalid chain supplied
459
459
IList < X509Certificate2 > trustBundle = new List < X509Certificate2 > ( ) { caCert } ;
460
460
string deviceId = "different from CN" ;
@@ -529,8 +529,8 @@ public async Task AuthenticateAsyncWithModuleCAX509InScopeCacheFails()
529
529
{
530
530
var notBefore = DateTime . Now . Subtract ( TimeSpan . FromDays ( 2 ) ) ;
531
531
var notAfter = DateTime . Now . AddYears ( 1 ) ;
532
- var ( caCert , caKeyPair ) = TestCertificateHelper . GenerateSelfSignedCert ( "MyTestCA" , notBefore , notAfter , true ) ;
533
- var ( issuedClientCert , issuedClientKeyPair ) = TestCertificateHelper . GenerateCertificate ( "MyIssuedTestClient" , notBefore , notAfter , caCert , caKeyPair , false , null , null ) ;
532
+ var caCert = TestCertificateHelper . GenerateSelfSignedCert ( "MyTestCA" , notBefore , notAfter , true ) ;
533
+ var issuedClientCert = TestCertificateHelper . GenerateCertificate ( "MyIssuedTestClient" , notBefore , notAfter , caCert , false , null , null ) ;
534
534
IList < X509Certificate2 > issuedClientCertChain = new List < X509Certificate2 > ( ) { caCert } ;
535
535
IList < X509Certificate2 > trustBundle = new List < X509Certificate2 > ( ) { caCert } ;
536
536
string deviceId = "d1" ;
0 commit comments