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 pairs for each environment (UAT and PROD) and share only the public keys with us.
Based on the public keys 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) keys for UAT and PROD environments:

#!/bin/bash

# Function to generate elliptic curve private and public keys

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 keys for UAT, and PROD

generate_keys "uat"

generate_keys "prod"

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:

  • uat-public.pem

  • prod-public.pem