Programmatically Create X509 Certificate using OpenSSL

后端 未结 4 510
暖寄归人
暖寄归人 2020-11-27 10:25

I have a C/C++ application and I need to create a X509 pem certificate containing both a public and private key. The certificate can be self signed, or unsigned, doesn\'t m

4条回答
  •  忘掉有多难
    2020-11-27 10:50

    Any chance of doing this via a system call from within your app? Several good reasons for doing this:

    • Licensing: Calling the openssl executable arguably separates it from your application and may provide certain advantages. Disclaimer: consult a lawyer on this.

    • Documentation: OpenSSL comes with phenomenal command-line documentation that greatly simplifies a potentially complicated tool.

    • Testability: you can exercise OpenSSL from the command line until you understand exactly how to create your certs. There are a lot of options; expect to spend about a day on this until you get all the details right. After that, it's trivial to incorporate the command into your app.

    If you choose to use the API, check the openssl-dev developers' list on www.openssl.org.

    Good luck!

提交回复
热议问题