Image
how to start

Generating Public Keys

This simple guide will help you to generate keys for our API

Generating Public Keys

In order for us to provide you access to one of our APIs, you must generate key pair and share only the public keys with us.
Based on the public key you provide, we will generate an ID for you. Together with your private key, this ID will be used to generate a token that allows you to access the API.
A token generation example can be found here: https://www.developer.circlek.com/how-to-generate-tokens-and-make-api-requests-to-circle-k-api

Key Pair Generation Script

Use the following Bash script to generate elliptic curve (EC) key:

#!/bin/bash

# Function to generate elliptic curve key

generate_keys() {

  local env=$1

  echo "Generating elliptic curve keys for $env..."

  # Generate EC private key

  openssl genpkey -algorithm EC -out ${env}-private.pem -pkeyopt ec_paramgen_curve:prime256v1

  # Generate the corresponding public key

  openssl ec -in ${env}-private.pem -pubout -out ${env}-public.pem

  echo "$env keys generated: ${env}-private.pem and ${env}-public.pem"

}

# Generate key

generate_keys "ECkey"

echo "All elliptic curve keys have been generated successfully."

Instructions for Running the Script:

Copy the script into a file, for example, generate_keys.sh.

Run the script in a bash terminal:

  • chmod +x generate_keys.sh
  • ./generate_keys.sh

After running the script, you will have the following files:

  • ECkey-private.pem

  • ECkey-public.pem

Public key should be shared with us, while private key, together with the Okta ID, will be used to generate an Okta token ( https://www.developer.circlek.com/how-to-generate-tokens-and-make-api-requests-to-circle-k-api )