コード例 #1
0
ファイル: TestClass.cs プロジェクト: pharry22/HttpSysManager
        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);
        }
コード例 #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);
            }
        }
コード例 #3
0
ファイル: TestClass.cs プロジェクト: pharry22/HttpSysManager
        public void CanReadExistingCTL()
        {
            var ctl = CTLContext.Load(AuthRootCTL);

            Assert.NotNull(ctl);
        }