---
title: "Creating a private/public key pair for Tiny Cloud"
description: "Instructions on how to generate private/public key pairs for the Tiny Cloud"
canonical_url: "https://www.tiny.cloud/docs/tinymce/latest/generate-rsa-key-pairs/"
md_url: "https://www.tiny.cloud/docs/tinymce/6/generate-rsa-key-pairs/index.md"
version: "6"
last_updated: "2022-03-31T00:32:33Z"
tokens: 1557
---
Important This page documents TinyMCE 6. For new projects, Tiny recommends using the latest, most up-to-date version. [See TinyMCE 8 documentation](../../latest/generate-rsa-key-pairs/).
# Creating a private/public key pair for Tiny Cloud

The procedure for creating a key pair depends on the operating system of the host machine.

- [Linux procedure](#linux).
- [Apple macOS procedure](#apple-macos).
- [Microsoft Windows procedure](#microsoft-windows).

## Linux

To create a private/public key pair on a Linux operating system:

1. [Install OpenSSL](#installing-openssl-on-linux).
2. [Create a private/public key pair](#create-a-private-public-key-pair-on-linux).
3. [Retrieve the public key](#retrieve-the-public-key-on-linux).

### Installing OpenSSL on Linux

The procedure for installing OpenSSL on Linux distributions varies. The installation commands for common Linux distributions have been provided here.

#### Red Hat Enterprise Linux 7 or CentOS 7

On a command line, run the following commands to install OpenSSL on:

- Red Hat Enterprise Linux 6 or 7.
- CentOS 6 or 7.

```sh
sudo yum check-update
sudo yum install openssl
```

#### Red Hat Enterprise Linux 8+, Fedora, or CentOS 8+

On a command line, run the following commands to install OpenSSL on:

- Red Hat Enterprise Linux 8 or later.
- CentOS 8 or later.
- Fedora 18 or later.

```sh
sudo dnf check-update
sudo dnf install openssl
```

#### Debian, Ubuntu, Linux Mint, or other Debian-based distributions

On a command line, run the following commands to install OpenSSL on Debian-based operating systems (such as: Debian, Ubuntu, and Linux Mint).

```sh
sudo apt update
sudo apt install openssl
```

#### SUSE Linux Enterprise Server or openSUSE

On a command line, run the following commands to install OpenSSL on openSUSE-based operating systems (such as: openSUSE and SUSE Linux Enterprise Server).

```sh
sudo zypper refresh
sudo zypper install openssl
```

### Create a private/public key pair on Linux

To create a private/public key pair:

1. On a command line, run:

```sh
ssh-keygen -m PEM -t rsa -b 2048 -f <MY_KEY_PAIR_NAME>
```
Where `<MY_KEY_PAIR_NAME>` should be replaced with a name for the key pair.
2. (Optional) Enter a passphrase for accessing the private key.

> **Important:** Some libraries used for generating JWTs do not support private keys encrypted with a passphrase. When passphrases are not supported, leave the passphrase blank or include `-N ""` option for the `ssh-keygen` command.
Two files will be created in the current directory:

- `<MY_KEY_PAIR_NAME>` - The private key.
- `<MY_KEY_PAIR_NAME>.pub` - The public key.

### Retrieve the public key on Linux

To retrieve the public key, on a command line, run:

```sh
openssl rsa -in <MY_KEY_PAIR_NAME> -outform DER -pubout | base64 -w0
```
The public key for the `<MY_KEY_PAIR_NAME>` key pair will be printed on the command line with base64 encoding.

## Apple macOS

To create a private/public key pair on a macOS operating system:

1. [Create a private/public key pair](#create-a-private-public-key-pair-on-macos).
2. [Retrieve the public key](#retrieve-the-public-key-on-macos).

### Create a private/public key pair on macOS

To create a private/public key pair:

1. Using **Finder**, open a **Terminal**.
2. On a terminal, run:

```sh
ssh-keygen -m PEM -t rsa -b 2048 -f <MY_KEY_PAIR_NAME>
```
Where `<MY_KEY_PAIR_NAME>` should be replaced with a name for the key pair.
3. (Optional) Enter a passphrase for accessing the private key.

> **Important:** Some libraries used for generating JWTs do not support private keys encrypted with a passphrase. When passphrases are not supported, leave the passphrase blank or include `-N ""` option for the `ssh-keygen` command.
Two files will be created in the current directory:

- `<MY_KEY_PAIR_NAME>` - The private key.
- `<MY_KEY_PAIR_NAME>.pub` - The public key.

### Retrieve the public key on macOS

To retrieve the public key, on a terminal, run:

```sh
openssl rsa -in <MY_KEY_PAIR_NAME> -outform DER -pubout | base64 -
```
The public key for the `<MY_KEY_PAIR_NAME>` key pair will be printed on the terminal with base64 encoding.

## Microsoft Windows

To create a private/public key pair on a Microsoft Windows operating system:

1. [Install OpenSSL](#installing-openssl-on-microsoft-windows).
2. [Create a private/public key pair](#create-a-private-public-key-pair-on-windows).
3. [Retrieve the public key](#retrieve-the-public-key-on-windows).

### Installing OpenSSL on Microsoft Windows

To install OpenSSL with *Git for Windows*:

1. Download the *Windows* package from [the Git Downloads page](https://git-scm.com/downloads).
2. Open the downloaded file `Git-<VERSION>-<ARCH>-bit.exe`, where `<VERSION>` is the latest version of *Git for Windows* and `<ARCH>` is the architecture, such as *32-bit* or *64-bit*.
3. Click **Next** on the *Information* and *Select Destination Location* screens.
4. Select **Check daily for Git for Windows updates** on the *Select Components* screen, then click **Next**.
5. Click **Next** on the remaining screens to accept the default settings.
6. Once the installation is complete, click **Finish**.

### Create a private/public key pair on Windows

To create a private/public key pair:

1. Open the **Start** menu (or *Windows* menu) and open **Git Bash**.
2. On the *Git bash* command line, run:

```sh
ssh-keygen -m PEM -t rsa -b 2048 -f <MY_KEY_PAIR_NAME>
```
Where `<MY_KEY_PAIR_NAME>` should be replaced with a name for the key pair.
3. (Optional) Enter a passphrase for accessing the private key.

> **Important:** Some libraries used for generating JWTs do not support private keys encrypted with a passphrase. When passphrases are not supported, leave the passphrase blank or include `-N ""` option for the `ssh-keygen` command.
Two files will be created in the current directory:

- `<MY_KEY_PAIR_NAME>` - The private key.
- `<MY_KEY_PAIR_NAME>.pub` - The public key.

### Retrieve the public key on Windows

To retrieve the public key, on a *Git bash* command line, run:

```sh
openssl rsa -in <MY_KEY_PAIR_NAME> -outform DER -pubout | base64 -w0
```
The public key for the `<MY_KEY_PAIR_NAME>` key pair will be printed on the command line with base64 encoding.
