How to generate intermediate and root cert from an existing leaf certificate?

谁都会走 提交于 2019-12-11 07:55:04

问题


Now i have a X509 leaf certificate. From the certification path to see, there's a intermediate cert and a root cert in it.

I want to generate the intermediate cert(..CA- G3) and the root cert(VerSign). Currently, my way is to double click the intermediate one and then click "Copy to file.." to export it. Do same for the root one too. Is this way to correct to generate intermediate/root certs?

From my test result, it seems the generated root cert with wrong fingerprint. The fingerpring doesn't match the one on server side.

Anyone can help on how to generate intermediate/root certs correctly?


回答1:


You have fundamental misunderstanding of certificates and certificate chains.

CA and Root certificates are searched for and found, not generated.

Some certificates include location of their CA certificate in the body of the certificate (in special certificate extension). For others you need to look in your CA certificates storage (this is what Windows does). Sometimes chains are sent together with end-entity certificate (depending on data format). Finally, sometimes CA and Root are just not available.




回答2:


[supply the answer... , maybe this is an alternative approach to get all certs that the SSL server using]

To retrieve the ntermediate and root certs by OpenSSL command:

  openssl s_client -showcerts -connect [host]:[port]


来源:https://stackoverflow.com/questions/11076491/how-to-generate-intermediate-and-root-cert-from-an-existing-leaf-certificate

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