将 mozilla firefox 证书存储访问到 HCERTSTORE

Access mozilla firefox certificate store to HCERTSTORE

需要在 Mozilla Firefox 证书库中添加自定义证书 "MycustomCert.pem" 信任列表。如何修改 Mozilla 证书存储中的受信任证书列表?

获取windowsROOT证书库的示例代码。而不是 root 需要获得 Mozilla 证书对 HCERTSTORE 数据结构

的访问权限
int main()
{
    HCERTSTORE hRootStore;   

    hRootStore = CertOpenStore(CERT_STORE_PROV_SYSTEM, 0, 0, CERT_STORE_OPEN_EXISTING_FLAG | CERT_SYSTEM_STORE_LOCAL_MACHINE, L"ROOT");
    if (!hRootStore)
        return 1;  

    CertCloseStore(hRootStore, 0); 
    return 0;
}

give alternative methods are other than using certutils.exe

我遇到了这个问题,我创建了一个批处理文件来将证书添加到 mozilla 商店,

set certificateFile=Ourcert.pem
set certificateName=UurCertName
Set FFProfdir=%Appdata%\mozilla\firefox\profiles
DIR %FFProfDir% /A:D /B > "%Temp%\FFProfile.txt" 
FOR /F "tokens=*" %%i in (%Temp%\FFProfile.txt) do ( call :Foo %%i  
) 
pause

:Foo
set cetDbLoc=%FFProfdir%\%1
C:\nss3.13.5nspr4.9.1x86\bin\certutil -A -n %certificateName% -t "TCu,Cuw,Tuw" -i %certificateFile% -d %cetDbLoc%
:End

您必须从 mozilla 下载 nss tools 并使用 nss tools 中的 certutil 而不是 windows 默认值 certutil