[Awesome Security] Create a self-signed certificate with OpenSSL
OpenSSL
OpenSSL is a robust, commercial-grade, and full-featured toolkit for the Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols. It is also a general-purpose cryptography library. For more information about the team and community around the project, or to start making your own contributions, start with the community page. To get the latest news, download the source, and so on, please see the sidebar or the buttons at the top of every page.
In this article, we’ll learn how to create a self-signed certificate with OpenSSL.
Usages
(Quickly) Create SelfSigned Domain Certificate
1 | openssl req \ |
Then it generate the Certificate with Public Key domain.crt
and Private Key domain.key
.
1 | tree . |
1 | openssl x509 \ |
(Step by Step) Create SelfSigned Domain Certificate by CA
Creating a Private Key
First, we’ll create a private key. A private key helps to enable encryption and is the most important component of our certificate.
Let’s create a password-protected, 2048-bit RSA private key (domain.key
) with the openssl command:
1 | openssl genrsa -des3 -out domain.key 2048 |
If we want our private key unencrypted, we can simply remove the -des3
option from the command.
References
[1] OpenSSL Cryptography and SSL/TLS Toolkit - https://www.openssl.org/