public void CanCreateSerializeAndReloadCTLContext() { var ctlBuilder = new CTLContextBuilder(); ctlBuilder.CTLInfo.Certificates.Add(TestCertificate); ctlBuilder.CTLInfo.ListIdentifier = "test list"; var ctlContext = ctlBuilder.ToCTLContext(); Assert.Equal("test list", ctlContext.FriendlyName); var bytes = ctlContext.ToBytes(); var loadedCtlContext = CTLContext.Load(bytes); Assert.Equal("test list", loadedCtlContext.FriendlyName); AssertCollectionEquals(TestCertificate.GetCertHash(), loadedCtlContext.CTLInfo.Entries[0].SubjectIdentifier); }
private void Import_CTL(object sender, RoutedEventArgs e) { if (ViewModel.CTLStoreNameProxy.store == null) { return; } OpenFileDialog fileDialog = new OpenFileDialog(); fileDialog.Filter = "STL files (*.stl)|*.stl"; fileDialog.CheckFileExists = true; fileDialog.CheckPathExists = true; var result = fileDialog.ShowDialog(); if (result.HasValue && result.Value) { var context = CTLContext.Load(File.ReadAllBytes(fileDialog.FileName)); ViewModel.ImportCTL(context); } }
public void CanReadExistingCTL() { var ctl = CTLContext.Load(AuthRootCTL); Assert.NotNull(ctl); }