Creating a Self-Signed Certificate in Windows

 Prerequisites

Install OpenSSL link below
Download OpenSSL

 

  1. Open Command Prompt or PowerShell
    Open it as an Administrator to ensure you have the necessary permissions.

  2. Navigate to the OpenSSL Directory 
    (default: cd "C:\Program Files\OpenSSL-Win64\bin")

  3. Generate the Private Key
    openssl genrsa -out myprivatekey.key 2048

  4.   Create the Certificate Signing Request (CSR)
    openssl req -new -key myprivatekey.key -out myrequest.csr

    Follow the prompts to enter your information, such as country, state, and Common Name (your domain or IP).

  5. Generate the Self-Signed Certificate
    openssl x509 -req -days 365 -in myrequest.csr -signkey myprivatekey.key -out mycertificate.crt
    Note: -days 365 specifies the certificate's validity period (1 year).

  6. Verify
    Your self-signed certificate (mycertificate.crt) and private key (myprivatekey.key) are now created in the current directory.

Post a Comment

Previous Post Next Post