Creating private and public key pair for Mac MDM using OpenSSL
search cancel

Creating private and public key pair for Mac MDM using OpenSSL

book

Article ID: 389288

calendar_today

Updated On:

Products

Client Management Suite IT Management Suite

Issue/Introduction

When going through the MDM for Mac instructions, it requires that a private and public key be created using OpenSSL.  How is this done?

Resolution

To create a public key using OpenSSL, you first generate a private key using the openssl genrsa command, then extract the public key from that private key using the openssl rsa -pubout command, specifying the private key file as input and the desired output file for the public key; essentially, you don't generate a public key separately, but rather extract it from the private key that contains both parts. 
 
Generate a private key:
  • openssl genrsa -out private.key 2048
  • This creates a private key named "private.key" with a key size of 2048 bits. 
     
Extract the public key:
  • openssl rsa -in private.key -pubout -out public.key 
  • This command takes the private key "private.key" as input, extracts the public key information, and writes it to a new file called "public.key". 
     
Explanation of the command options:
    • openssl: The command to launch OpenSSL.
    • genrsa: Command to generate an RSA key pair.
    • -out: Specifies the output file name.
    • -pubout: Option to extract the public key from the private key.
    • -in: Specifies the input file (the private key).