2 # Copyright (C) The Arvados Authors. All rights reserved.
4 # SPDX-License-Identifier: AGPL-3.0
6 # This script uses ssh-keygen to generate an example public key for
7 # each supported type, to be used by test cases. Private keys are
8 # discarded. If ${keytype}.pub already exists, it is left alone.
13 keytypes=$(ssh-keygen -_ 2>&1 | grep -- -t | tr -d '[|]' | tr ' ' '\n' | grep -vw t)
14 for keytype in ${keytypes[@]}; do
15 if [[ ! -e "./${keytype}.pub" ]]; then
16 if ssh-keygen -t "${keytype}" -f "./${keytype}" -N ""; then
20 echo >&2 "ssh-keygen -t ${keytype} failed"