Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
            }
        }
Esempio n. 3
0
        public void CanReadExistingCTL()
        {
            var ctl = CTLContext.Load(AuthRootCTL);

            Assert.NotNull(ctl);
        }