$ErrorActionPreference = "Stop"
$src = Join-Path $env:USERPROFILE ".ssh\id_ed25519_cnperp"
$dst = Join-Path $env:TEMP "cnperp_deploy_key_ed25519"
$pass = "casmic123"
if (-not (Test-Path $src)) { throw "Missing SSH key: $src" }
Copy-Item -Force $src $dst
Copy-Item -Force "$src.pub" "$dst.pub" -ErrorAction SilentlyContinue
& ssh-keygen -p -P $pass -N '""' -f $dst -q 2>$null
if ($LASTEXITCODE -ne 0) { throw "ssh-keygen failed to prepare deploy key" }
Write-Output $dst
