Talk with a Hovatek Engineer/Developer. Start Now

Learn Mediatek Software Repairs Online! Enroll




How to generate a custom signing key (.pem) using OpenSSL
#1

Post: 1 by hovatek



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



Note!
We have a reply schedule for Free Support. Please upgrade to Private Support if you can't wait.
find Reply
#2

Post: 2 by nheaven

Why I can't get a .pem file after running OpenSSL in the bin folder?
find Reply
#3

Post: 3 by X3non

(07-09-2021, 04:44 AM)nheaven Wrote:  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
find Reply
#4

Post: 4 by nheaven

(07-09-2021, 11:45 AM)X3non Wrote:  
(07-09-2021, 04:44 AM)nheaven Wrote:  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
find Reply
#5

Post: 5 by Kelexine

(07-09-2021, 11:45 AM)X3non Wrote:  
(07-09-2021, 04:44 AM)nheaven Wrote:  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
find Reply




Users browsing this thread: 1 Guest(s)
YouTubeWhatsappTelegram

© 2023. Powered by Hovatek...just a button away! Software by MyBB.