我使用的是Windows10。我没有makecert.exe,当我尝试运行命令生成makecert.exe
之类的证书时,我就知道了
我得到了错误:
“‘makecert”不被认为是内部或外部命令、可操作的程序或批处理文件。
我已经为windows 10安装了windows。
发布于 2018-07-19 09:05:05
它可能被安装了,但可能不在路径上。
例如,我可以在C:\Program Files (x86)\Windows Kits\10\bin\10.0.16299.0\x64
下找到它,但也可以在C:\Program Files (x86)\Windows Kits\10\bin\10.0.16299.0\x86
下找到另一个。路径中的确切版本将根据您安装的SDK的确切版本而有所不同。
但是,这些路径都不在我的PATH
环境变量中(我不记得在安装SDK之后显式地删除它),所以我不能仅仅在命令行上说makecert
,我必须给出我想要运行的路径的完整路径。
where
命令是查找副本位置的一种方便的方法。在这里,我的搜索仅限于SDK目录,但如果需要,可以搜索整个硬盘驱动器:
C:\Users\Damien>where /R "C:\Program Files (x86)\Windows Kits" makecert.*
C:\Program Files (x86)\Windows Kits\10\bin\10.0.16299.0\arm64\makecert.exe
C:\Program Files (x86)\Windows Kits\10\bin\10.0.16299.0\x64\makecert.exe
C:\Program Files (x86)\Windows Kits\10\bin\10.0.16299.0\x86\makecert.exe
发布于 2020-12-06 13:06:14
目前,powershell 'New-SelfSignedCertificate‘(作为)的新方法makecert已经折旧,例如:
1.- We create a new root trusted cert:
$rootCert = New-SelfSignedCertificate -Subject 'CN=TestRootCA,O=TestRootCA,OU=TestRootCA' -KeyExportPolicy Exportable -KeyUsage CertSign,CRLSign,DigitalSignature -KeyLength 2048 -KeyUsageProperty All -KeyAlgorithm 'RSA' -HashAlgorithm 'SHA256' -Provider 'Microsoft Enhanced RSA and AES Cryptographic Provider'
2.- We create the cert from the root trusted cert chain:
New-SelfSignedCertificate -DnsName "localhost" -FriendlyName "MyCert" -CertStoreLocation "cert:\LocalMachine\My" -Signer $rootCert -TextExtension @("2.5.29.37={text}1.3.6.1.5.5.7.3.1") -Provider "Microsoft Strong Cryptographic Provider" -HashAlgorithm "SHA256" -NotAfter (Get-Date).AddYears(10)
3.- We copy the thumbprint returned by the last command
4.- (If neccesary) We remove the last association ip/port/cert:
netsh http delete sslcert ipport=0.0.0.0:443
5.- We associate the new certificate with any ip and port 443 (the appid value does not matter, is any valid guid):
netsh http add sslcert ipport=0.0.0.0:443 appid='{214124cd-d05b-4309-9af9-9caa44b2b74a}' certhash=here_the_copied_thumbprint
6.- Now, you must open MMC (Certificates Local Computer) and drag and drop the TestRootCA Personal/Certificates folder to Trusted Root Certification Authorities/Certificates.
这些命令还解决了Google稍后返回的错误ERR_CERT_WEAK_SIGNATURE_ALGORITHM,因为证书是用SHA1而不是SHA256创建的
发布于 2019-01-07 08:11:19
我就是这样安装makecert.exe文件的
(注意:我首先安装了Windows10SDK,但是这个版本没有在"bin“目录下安装makecert.exe。没有问题!)
https://stackoverflow.com/questions/51418366
复制相似问题