Create Self Signed Certificate with Subject Key Identifier

大城市里の小女人 提交于 2021-01-28 07:43:19

问题


I want to create a self signed certificate with RSA algorithm keysize 2048 with subject key identifier. I know we made some some default change in openssl.conf. What i suppose to change?

genrsa -des3 -out mcedt.key 2048
req -new -key mcedt.key -out mcedt.csr
CN = server.test , OU =, O =, L = Toronto, S = ontario , C = can
x509 -req -days 365 -in mcedt.csr -signkey mcedt.key -out mcedt.crt
pkcs12 -export -in mcedt.crt -inkey mcedt.key -out mcedt.pfx

回答1:


You could create an extension file (extensions.cnf) with the following information:

subjectKeyIdentifier=hash

as mentioned by OpenSSL :

This is really a string extension and can take two possible values. Either the word hash which will automatically follow the guidelines in RFC3280 or a hex string giving the extension value to include. The use of the hex string is strongly discouraged.

Then you should change

x509 -req -days 365 -in mcedt.csr -signkey mcedt.key -out mcedt.crt

into

x509 -req -days 365 -extfile extensions.cnf -in mcedt.csr -signkey mcedt.key -out mcedt.crt


来源:https://stackoverflow.com/questions/21179132/create-self-signed-certificate-with-subject-key-identifier

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!