2017-04-03 23 views
0

我使用Fiddler DLL安裝小提琴手證書:如何導出根證書(小提琴手)

public static bool InstallCertificate() 
    { 
     if (!string.IsNullOrEmpty(certmakerBcCert)) 
     { 
      FiddlerApplication.Prefs.SetStringPref("fiddler.certmaker.bc.key", certmakerBcKey); 
      FiddlerApplication.Prefs.SetStringPref("fiddler.certmaker.bc.cert", certmakerBcCert); 
     } 

     if (!CertMaker.rootCertExists()) 
     { 
      //CLog.writeNoLogInDB("Creating SSL certificate"); 
      if (!CertMaker.createRootCert()) 
       return false; 

      if (!CertMaker.trustRootCert()) 
       return false; 

      certmakerBcCert = FiddlerApplication.Prefs.GetStringPref("fiddler.certmaker.bc.cert", null); 
      certmakerBcKey = FiddlerApplication.Prefs.GetStringPref("fiddler.certmaker.bc.key", null); 
     } 
     return true; 
    } 

我需要導出通過代碼創建的RootCertificate文件。有沒有一種方法可以做到這一點?

回答

1

(我知道這是舊的,但櫃面你還沒有找到答案,或者是別人搜索)基於您的代碼,它看起來像使用的BouncyCastle的製造商證明書,這樣你就可以做到這一點,以

導出根certficiate:

FiddlerApplication.Prefs.SetBoolPref("fiddler.certmaker.bc.EmitRootCertFile", true) 

這將轉儲「FiddlerBCRoot.pfx」在桌面上用空密碼