#!/usr/bin/env bash# Never trace secret values, even if a caller enables shell tracing.set +xset -euo pipefail#shellcheck source=build_files/prep/check-signing-key.shsource "$(dirname "$0")/check-signing-key.sh"load_signing_keys "${1:-certs}" productionfor id in "${KSIGN_IDS[@]}"; do[[ -n "${!id:-}" ]] || { echo "Missing signing secret: $id" >&2; exit 1; }doneumask 077tmp=''trap '[[ -z "$tmp" ]] || rm -f "$tmp"' EXITfor id in "${KSIGN_IDS[@]}"; dotmp=$(mktemp "$KSIGN_DIR/.$id.XXXXXX")printf '%s\n' "${!id}" > "$tmp"check_signing_key "$tmp" "$KSIGN_DIR/$id.der"mv -f "$tmp" "$KSIGN_DIR/$id.key"tmp=''done