如何使用 sha512 创建 pkcs12 证书
How to create a pkcs12-certificate using sha512
我正在这样创建我的证书:
openssl genrsa -out rootCA.key 2048
openssl req -x509 -new -key rootCA.key -sha512 -days 36501 -out rootCA.pem \
-extensions v3_req
openssl genrsa -out client1.key 2048
openssl req -new -key client1.key -sha512 -days 36500 -out client1.csr \
-extensions v3_req
openssl x509 -req -days 36500 -CA rootCA.pem -CAkey rootCA.key \
-CAcreateserial -CAserial serial -in client1.csr -out client1.pem
openssl verify -verbose -CAfile rootCA.pem client1.pem
openssl pkcs12 -export -in client1.pem -inkey client1.key -out client1.p12 -name "client1"
我想要 .p12 证书使用 sha512 算法。我考虑过将选项 -sha512 添加到转换(最后一行),但似乎 pkcs12 没有这个选项。有什么想法吗?
PKCS#12支持以下私钥加密算法。
- 128 位 RC4 和 SHA1
- 40 位 RC4 和 SHA1
- 3 密钥三重 DES 与 SHA1(168 位)
- 2 密钥三重 DES 与 SHA1(112 位)
- 128 位 RC2 和 SHA1
- 40 位 RC2 和 SHA1
默认使用 3 密钥三重 DES,因此如果您愿意,无需提供 -des3。
您可以使用以下命令从生成的 pkcs12 文件中输出一些信息:
openssl pkcs12 -in client1.p12 -noout -info
附带说明一下,当您生成 x509 客户端证书时,如果您想使用 sha-512 哈希函数,则需要提供 -sha512 参数。
验证是否实际使用了sha512哈希函数:
openssl x509 -in client1.pem -noout -text
如果没有,则使用 -sha512 重新创建它
openssl x509 -sha512 -req -days 36500 -CA rootCA.pem -CAkey rootCA.key \
-CAcreateserial -CAserial serial -in client1.csr -out client1.pem
我正在这样创建我的证书:
openssl genrsa -out rootCA.key 2048
openssl req -x509 -new -key rootCA.key -sha512 -days 36501 -out rootCA.pem \
-extensions v3_req
openssl genrsa -out client1.key 2048
openssl req -new -key client1.key -sha512 -days 36500 -out client1.csr \
-extensions v3_req
openssl x509 -req -days 36500 -CA rootCA.pem -CAkey rootCA.key \
-CAcreateserial -CAserial serial -in client1.csr -out client1.pem
openssl verify -verbose -CAfile rootCA.pem client1.pem
openssl pkcs12 -export -in client1.pem -inkey client1.key -out client1.p12 -name "client1"
我想要 .p12 证书使用 sha512 算法。我考虑过将选项 -sha512 添加到转换(最后一行),但似乎 pkcs12 没有这个选项。有什么想法吗?
PKCS#12支持以下私钥加密算法。
- 128 位 RC4 和 SHA1
- 40 位 RC4 和 SHA1
- 3 密钥三重 DES 与 SHA1(168 位)
- 2 密钥三重 DES 与 SHA1(112 位)
- 128 位 RC2 和 SHA1
- 40 位 RC2 和 SHA1
默认使用 3 密钥三重 DES,因此如果您愿意,无需提供 -des3。
您可以使用以下命令从生成的 pkcs12 文件中输出一些信息:
openssl pkcs12 -in client1.p12 -noout -info
附带说明一下,当您生成 x509 客户端证书时,如果您想使用 sha-512 哈希函数,则需要提供 -sha512 参数。
验证是否实际使用了sha512哈希函数:
openssl x509 -in client1.pem -noout -text
如果没有,则使用 -sha512 重新创建它
openssl x509 -sha512 -req -days 36500 -CA rootCA.pem -CAkey rootCA.key \
-CAcreateserial -CAserial serial -in client1.csr -out client1.pem