Join us on Tl   Wh

Hovatek Forum DEVELOPMENT Android [Tutorial] How to generate a custom signing key (.pem) using OpenSSL

[Tutorial] How to generate a custom signing key (.pem) using OpenSSL

[Tutorial] How to generate a custom signing key (.pem) using OpenSSL

hovatek
hovatek
hovatek
Administrator
49,753
12-03-2020, 07:20 PM
#1



This guide will explain how to generate a custom key which can be used to sign your Android images like boot, recovery, system etc. This guide will come in handy in a case where the bootloader only accepts signed images (whether self-signed or factory-signed).

Requirements


Steps to create a custom signing key using OpenSSL


Follow the steps below to generate a custom private key

See the video tutorial below or @ https://youtu.be/uICvoalIUf8

  1. Tap the Start menu and search for cmd.exe

    [Image: How-to-generate-a-custom-signing-key-1.png]

  2. Right-click CMD from the results and run as Administrator

    [Image: How-to-generate-a-custom-signing-key-2.png]

  3. Click Yes when prompted
  4. Open the directory where OpenSSL was installed to and open the bin folder (mine is C:\Program Files\OpenSSL-Win64\bin . Ensure to enter yours in the command below)

    [Image: How-to-generate-a-custom-signing-key-3.png]

  5. Right-click the address bar and select Copy address

    [Image: How-to-generate-a-custom-signing-key-4.png]

  6. Go back to command prompt, type this command (use your own location) and tap Enter
    Code:

    cd C:\Program Files\OpenSSL-Win64\bin

    [Image: How-to-generate-a-custom-signing-key-5.png]

  7. You should now be in the C:\Program Files\OpenSSL-Win64\bin at command prompt

    [Image: How-to-generate-a-custom-signing-key-6.png]

  8. Type this command (I've chosen to name my key hovatek) and tap Enter
    Code:

    openssl genrsa -f4 -out hovatek.pem 4096

    [Image: How-to-generate-a-custom-signing-key-7.png]

  9. Wait till its done (i.e back to C:\Program Files\OpenSSL-Win64\bin>_)

    [Image: How-to-generate-a-custom-signing-key-8.png]

  10. You should now find a hovatek.pem file

    [Image: How-to-generate-a-custom-signing-key-9.png]

Important Notice
  • Your OpenSSL installation directory might vary from mine so ensure to enter yours
  • The generated .pem file is a custom one and very likely to be different from what your device's OEM uses to sign its images
This post was last modified: 12-03-2020, 08:42 PM by hovatek.

Note!
We have a reply schedule for Free Support. Please upgrade to Private Support if you can't wait.
nheaven
nheaven
nheaven
Junior Member
30
07-09-2021, 04:44 AM
#2
Why I can't get a .pem file after running OpenSSL in the bin folder?
hovatek
hovatek
hovatek
Administrator
49,753
07-09-2021, 11:45 AM
#3
(07-09-2021, 04:44 AM)nheaven Why I can't get a .pem file after running OpenSSL in the bin folder?

depends on the folder path where you ran the openssl command and what command you sent
you should upload a screenshot showing your cmd prompt window
nheaven
nheaven
nheaven
Junior Member
30
07-09-2021, 08:27 PM
#4
(07-09-2021, 11:45 AM)X3non
(07-09-2021, 04:44 AM)nheaven Why I can't get a .pem file after running OpenSSL in the bin folder?

depends on the folder path where you ran the openssl command and what command you sent
you should upload a screenshot showing your cmd prompt window

I can get the output in Linux, but not in windows 7
Kelexine
Kelexine
Kelexine
Senior Member
152
12-01-2023, 10:50 AM
#5



(07-09-2021, 11:45 AM)X3non
(07-09-2021, 04:44 AM)nheaven Why I can't get a .pem file after running OpenSSL in the bin folder?

depends on the folder path where you ran the openssl command and what command you sent
you should upload a screenshot showing your cmd prompt window
you can just add it to path in environmentalal variables
Users browsing this thread:
 1 Guest(s)
Users browsing this thread:
 1 Guest(s)
Join us
WhTlYt