使用PowerShell创建2048位长度的自签名证书

时间:2018-01-22 12:48:57

标签: powershell ssl ssl-certificate

我使用bellow函数生成自签名证书,以便将其用于IIS。 我的问题是如何使用长度为2048位的公钥生成证书? 我已将$ key.Length更改为2048但是当我生成证书时,公钥只有1024位。

GET /test_index/students/_search
{
  "from": 0,
  "query": {
    "bool": {
      "must": [
        {"match": {"age": "20"}}
      ],
      "should": [
        {
          "match": {
            "category": {
              "boost": "10",
              "query": "students"
            }
          }
        }
      ]
    }
  },
  "size": "10"
}

2 个答案:

答案 0 :(得分:0)

为什么不首先生成2048,然后将其添加为:

New-SelfSignedCertificate -Type Custom -Subject "E=a.b@test.com,CN=user" -TextExtension @("2.5.29.37={text}1.3.6.1.5.5.7.3.4","2.5.29.17={text}email=a.b@test.com&upn=ab@test.com") -KeyUsage DataEncipherment -KeyAlgorithm RSA -KeyLength 2048 -SmimeCapabilities -CertStoreLocation "Cert:\CurrentUser\My"

然后在此之后你可以添加它。

希望它有所帮助。

答案 1 :(得分:0)

重启机器后,问题解决了,我运行了脚本,运行正常。

相关问题