コード例 #1
0
ファイル: RemoteHook.cs プロジェクト: tloeb/carteiro_win
 private static void SetWsusCertificate(string certPath, string certPass, IUpdateServer wServ)
 {
     if (wServ.IsConnectionSecureForApiRemoting)
     {
         try
         {
             var wsusConf = wServ.GetConfiguration();
             wsusConf.SetSigningCertificate(certPath, certPass);
             wsusConf.Save();
             Console.WriteLine("INFO: new Certificate imported");
         }
         catch (Exception e)
         {
             Console.Error.WriteLine("ERROR: " + e.Message);
         }
     }
     else
     {
         Console.Error.WriteLine("ERROR: this operation is not possible with an unsafe connection");
     }
 }