#!/bin/bash

# Generate private key
# openssl ecparam -genkey -name prime256v1 -noout -out ec256-private.pem
# openssl ec -in ec256-private.pem -outform DER | base64 -w 0

# Extract public key
# openssl ec -in ec256-private.pem -pubout -out ec256-public.pem
# openssl ec -in ec256-private.pem -pubout -outform DER | base64 -w 0

# Generate private key
openssl ecparam -genkey -name prime256v1 -noout -out ec256-private.pem

# Extract public key
openssl ec -in ec256-private.pem -pubout -out ec256-public.pem

echo ""
echo "Private Key (DER base64):"
openssl ec -in ec256-private.pem -outform DER | base64 -w 0

echo "
--------------------------------"

echo ""
echo "Public Key (DER base64):"
openssl ec -in ec256-private.pem -pubout -outform DER | base64 -w 0
