@@ -139,56 +139,6 @@ public ActionResult Privacy()
139
139
return View ( "Privacy" ) ;
140
140
}
141
141
142
- public ActionResult GenerateAAS ( )
143
- {
144
- try
145
- {
146
- string packagePath = Path . Combine ( Directory . GetCurrentDirectory ( ) , "UANodeSet.aasx" ) ;
147
- using ( Package package = Package . Open ( packagePath , FileMode . Create ) )
148
- {
149
- // add package origin part
150
- PackagePart origin = package . CreatePart ( new Uri ( "/aasx/aasx-origin" , UriKind . Relative ) , MediaTypeNames . Text . Plain , CompressionOption . Maximum ) ;
151
- using ( Stream fileStream = origin . GetStream ( FileMode . Create ) )
152
- {
153
- var bytes = Encoding . ASCII . GetBytes ( "Intentionally empty." ) ;
154
- fileStream . Write ( bytes , 0 , bytes . Length ) ;
155
- }
156
- package . CreateRelationship ( origin . Uri , TargetMode . Internal , "http://www.admin-shell.io/aasx/relationships/aasx-origin" ) ;
157
-
158
- // add package spec part
159
- PackagePart spec = package . CreatePart ( new Uri ( "/aasx/" + _nodeSetFilenames [ 0 ] , UriKind . Relative ) , MediaTypeNames . Text . Xml ) ;
160
- string submodelPath = Path . Combine ( Directory . GetCurrentDirectory ( ) , _nodeSetFilenames [ 0 ] ) ;
161
- using ( FileStream reader2 = new ( submodelPath , FileMode . Open ) )
162
- {
163
- CopyStream ( reader2 , spec . GetStream ( ) ) ;
164
- }
165
-
166
- origin . CreateRelationship ( spec . Uri , TargetMode . Internal , "http://www.admin-shell.io/aasx/relationships/aas-spec" ) ;
167
- }
168
-
169
- return File ( new FileStream ( Path . Combine ( Directory . GetCurrentDirectory ( ) , "UANodeSet.aasx" ) , FileMode . Open , FileAccess . Read ) , "APPLICATION/octet-stream" , "UANodeSet.aasx" ) ;
170
- }
171
- catch ( Exception ex )
172
- {
173
- Trace . TraceError ( ex . Message ) ;
174
-
175
- _session . StatusMessage = ex . Message ;
176
-
177
- return View ( "Error" , _session ) ;
178
- }
179
- }
180
-
181
- private void CopyStream ( Stream source , Stream target )
182
- {
183
- const int bufSize = 0x1000 ;
184
- byte [ ] buf = new byte [ bufSize ] ;
185
- int bytesRead = 0 ;
186
- while ( ( bytesRead = source . Read ( buf , 0 , bufSize ) ) > 0 )
187
- {
188
- target . Write ( buf , 0 , bytesRead ) ;
189
- }
190
- }
191
-
192
142
[ HttpPost ]
193
143
public ActionResult Error ( string errorMessage )
194
144
{
@@ -502,12 +452,12 @@ private async Task StartServerAsync()
502
452
ApplicationConfiguration config = await _application . LoadApplicationConfiguration ( Path . Combine ( Directory . GetCurrentDirectory ( ) , "Application.Config.xml" ) , false ) . ConfigureAwait ( false ) ;
503
453
504
454
// check the application certificate.
505
- await _application . CheckApplicationInstanceCertificate ( false , 0 ) . ConfigureAwait ( false ) ;
455
+ await _application . CheckApplicationInstanceCertificates ( false , 0 ) . ConfigureAwait ( false ) ;
506
456
507
457
// create cert validator
508
458
config . CertificateValidator = new CertificateValidator ( ) ;
509
459
config . CertificateValidator . CertificateValidation += new CertificateValidationEventHandler ( CertificateValidator_CertificateValidation ) ;
510
- config . CertificateValidator . Update ( config . SecurityConfiguration ) . GetAwaiter ( ) . GetResult ( ) ;
460
+ config . CertificateValidator . Update ( config ) . GetAwaiter ( ) . GetResult ( ) ;
511
461
512
462
// start the server.
513
463
await _application . Start ( new SimpleServer ( ) ) . ConfigureAwait ( false ) ;
0 commit comments