#!/bin/bash

# Check for argument
if [ "$#" -ne 1 ]; then
  echo "Usage: $0 <key_name>"
  exit 1
fi

key_name="$1"
target_dir="./$key_name"

# Create directory if it doesn't exist
mkdir -p "$target_dir"

# Full paths for private and public keys
private_key="$target_dir/$key_name"
public_key="$target_dir/$key_name.pub"

# Generate Ed25519 key without passphrase
ssh-keygen -t ed25519 -f "$private_key" -N "" -q

# Confirm creation
echo "SSH key pair created:"
echo "Private key: $private_key"
echo "Public key : $public_key"

