@@ -52,7 +52,7 @@ public void EnsureCreateHttpsCertificate_CreatesACertificate_WhenThereAreNoHttps
52
52
Assert . NotNull ( exportedCertificate ) ;
53
53
Assert . False ( exportedCertificate . HasPrivateKey ) ;
54
54
55
- var httpsCertificates = _manager . ListCertificates ( CertificatePurpose . HTTPS , StoreName . My , StoreLocation . CurrentUser , isValid : false ) ;
55
+ var httpsCertificates = CertificateManager . ListCertificates ( CertificatePurpose . HTTPS , StoreName . My , StoreLocation . CurrentUser , isValid : false ) ;
56
56
var httpsCertificate = Assert . Single ( httpsCertificates , c => c . Subject == TestCertificateSubject ) ;
57
57
Assert . True ( httpsCertificate . HasPrivateKey ) ;
58
58
Assert . Equal ( TestCertificateSubject , httpsCertificate . Subject ) ;
@@ -94,7 +94,7 @@ public void EnsureCreateHttpsCertificate_CreatesACertificate_WhenThereAreNoHttps
94
94
httpsCertificate . Extensions . OfType < X509Extension > ( ) ,
95
95
e => e . Critical == false &&
96
96
e . Oid . Value == "1.3.6.1.4.1.311.84.1.1" &&
97
- e . RawData [ 0 ] == _manager . AspNetHttpsCertificateVersion ) ;
97
+ e . RawData [ 0 ] == CertificateManager . AspNetHttpsCertificateVersion ) ;
98
98
99
99
Assert . Equal ( httpsCertificate . GetCertHashString ( ) , exportedCertificate . GetCertHashString ( ) ) ;
100
100
@@ -137,7 +137,7 @@ public void EnsureCreateHttpsCertificate_DoesNotCreateACertificate_WhenThereIsAn
137
137
now = new DateTimeOffset ( now . Year , now . Month , now . Day , now . Hour , now . Minute , now . Second , 0 , now . Offset ) ;
138
138
_manager . EnsureAspNetCoreHttpsDevelopmentCertificate ( now , now . AddYears ( 1 ) , path : null , trust : false , subject : TestCertificateSubject ) ;
139
139
140
- var httpsCertificate = _manager . ListCertificates ( CertificatePurpose . HTTPS , StoreName . My , StoreLocation . CurrentUser , isValid : false ) . Single ( c => c . Subject == TestCertificateSubject ) ;
140
+ var httpsCertificate = CertificateManager . ListCertificates ( CertificatePurpose . HTTPS , StoreName . My , StoreLocation . CurrentUser , isValid : false ) . Single ( c => c . Subject == TestCertificateSubject ) ;
141
141
142
142
// Act
143
143
var result = _manager . EnsureAspNetCoreHttpsDevelopmentCertificate ( now , now . AddYears ( 1 ) , CertificateName , trust : false , includePrivateKey : true , password : certificatePassword , subject : TestCertificateSubject ) ;
@@ -164,9 +164,9 @@ public void EnsureCreateHttpsCertificate_ReturnsExpiredCertificateIfVersionIsInc
164
164
now = new DateTimeOffset ( now . Year , now . Month , now . Day , now . Hour , now . Minute , now . Second , 0 , now . Offset ) ;
165
165
_manager . EnsureAspNetCoreHttpsDevelopmentCertificate ( now , now . AddYears ( 1 ) , path : null , trust : false , subject : TestCertificateSubject ) ;
166
166
167
- _manager . AspNetHttpsCertificateVersion = 2 ;
167
+ CertificateManager . AspNetHttpsCertificateVersion = 2 ;
168
168
169
- var httpsCertificateList = _manager . ListCertificates ( CertificatePurpose . HTTPS , StoreName . My , StoreLocation . CurrentUser , isValid : true ) ;
169
+ var httpsCertificateList = CertificateManager . ListCertificates ( CertificatePurpose . HTTPS , StoreName . My , StoreLocation . CurrentUser , isValid : true ) ;
170
170
Assert . Empty ( httpsCertificateList ) ;
171
171
}
172
172
@@ -178,12 +178,12 @@ public void EnsureCreateHttpsCertificate_ReturnsExpiredCertificateForEmptyVersio
178
178
179
179
DateTimeOffset now = DateTimeOffset . UtcNow ;
180
180
now = new DateTimeOffset ( now . Year , now . Month , now . Day , now . Hour , now . Minute , now . Second , 0 , now . Offset ) ;
181
- _manager . AspNetHttpsCertificateVersion = 0 ;
181
+ CertificateManager . AspNetHttpsCertificateVersion = 0 ;
182
182
_manager . EnsureAspNetCoreHttpsDevelopmentCertificate ( now , now . AddYears ( 1 ) , path : null , trust : false , subject : TestCertificateSubject ) ;
183
183
184
- _manager . AspNetHttpsCertificateVersion = 1 ;
184
+ CertificateManager . AspNetHttpsCertificateVersion = 1 ;
185
185
186
- var httpsCertificateList = _manager . ListCertificates ( CertificatePurpose . HTTPS , StoreName . My , StoreLocation . CurrentUser , isValid : true ) ;
186
+ var httpsCertificateList = CertificateManager . ListCertificates ( CertificatePurpose . HTTPS , StoreName . My , StoreLocation . CurrentUser , isValid : true ) ;
187
187
Assert . Empty ( httpsCertificateList ) ;
188
188
}
189
189
@@ -195,10 +195,10 @@ public void EnsureCreateHttpsCertificate_ReturnsValidIfVersionIsZero()
195
195
196
196
DateTimeOffset now = DateTimeOffset . UtcNow ;
197
197
now = new DateTimeOffset ( now . Year , now . Month , now . Day , now . Hour , now . Minute , now . Second , 0 , now . Offset ) ;
198
- _manager . AspNetHttpsCertificateVersion = 0 ;
198
+ CertificateManager . AspNetHttpsCertificateVersion = 0 ;
199
199
_manager . EnsureAspNetCoreHttpsDevelopmentCertificate ( now , now . AddYears ( 1 ) , path : null , trust : false , subject : TestCertificateSubject ) ;
200
200
201
- var httpsCertificateList = _manager . ListCertificates ( CertificatePurpose . HTTPS , StoreName . My , StoreLocation . CurrentUser , isValid : true ) ;
201
+ var httpsCertificateList = CertificateManager . ListCertificates ( CertificatePurpose . HTTPS , StoreName . My , StoreLocation . CurrentUser , isValid : true ) ;
202
202
Assert . NotEmpty ( httpsCertificateList ) ;
203
203
}
204
204
@@ -210,11 +210,11 @@ public void EnsureCreateHttpsCertificate_ReturnValidIfCertIsNewer()
210
210
211
211
DateTimeOffset now = DateTimeOffset . UtcNow ;
212
212
now = new DateTimeOffset ( now . Year , now . Month , now . Day , now . Hour , now . Minute , now . Second , 0 , now . Offset ) ;
213
- _manager . AspNetHttpsCertificateVersion = 2 ;
213
+ CertificateManager . AspNetHttpsCertificateVersion = 2 ;
214
214
_manager . EnsureAspNetCoreHttpsDevelopmentCertificate ( now , now . AddYears ( 1 ) , path : null , trust : false , subject : TestCertificateSubject ) ;
215
215
216
- _manager . AspNetHttpsCertificateVersion = 1 ;
217
- var httpsCertificateList = _manager . ListCertificates ( CertificatePurpose . HTTPS , StoreName . My , StoreLocation . CurrentUser , isValid : true ) ;
216
+ CertificateManager . AspNetHttpsCertificateVersion = 1 ;
217
+ var httpsCertificateList = CertificateManager . ListCertificates ( CertificatePurpose . HTTPS , StoreName . My , StoreLocation . CurrentUser , isValid : true ) ;
218
218
Assert . NotEmpty ( httpsCertificateList ) ;
219
219
}
220
220
@@ -241,10 +241,10 @@ public void EnsureAspNetCoreHttpsDevelopmentCertificate_CanRemoveCertificates()
241
241
242
242
_manager . CleanupHttpsCertificates ( TestCertificateSubject ) ;
243
243
244
- Assert . Empty ( _manager . ListCertificates ( CertificatePurpose . HTTPS , StoreName . My , StoreLocation . CurrentUser , isValid : false ) . Where ( c => c . Subject == TestCertificateSubject ) ) ;
244
+ Assert . Empty ( CertificateManager . ListCertificates ( CertificatePurpose . HTTPS , StoreName . My , StoreLocation . CurrentUser , isValid : false ) . Where ( c => c . Subject == TestCertificateSubject ) ) ;
245
245
if ( RuntimeInformation . IsOSPlatform ( OSPlatform . Windows ) )
246
246
{
247
- Assert . Empty ( _manager . ListCertificates ( CertificatePurpose . HTTPS , StoreName . Root , StoreLocation . CurrentUser , isValid : false ) . Where ( c => c . Subject == TestCertificateSubject ) ) ;
247
+ Assert . Empty ( CertificateManager . ListCertificates ( CertificatePurpose . HTTPS , StoreName . Root , StoreLocation . CurrentUser , isValid : false ) . Where ( c => c . Subject == TestCertificateSubject ) ) ;
248
248
}
249
249
}
250
250
}
0 commit comments