Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gen-keys: add scripts to generate secrets #70

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
38 changes: 38 additions & 0 deletions gen-keys/gen-keys.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/sh

# Copyright (C) Viktor Szakats. See LICENSE.md
# SPDX-License-Identifier: MIT

# shellcheck disable=SC3040,SC2039
set -o errexit -o nounset; [ -n "${BASH:-}${ZSH_NAME:-}" ] && set -o pipefail

[ -d workdir ] && rm -r -f workdir
mkdir -m 700 workdir
(
cd workdir

# 1. code signing certificate and key

name='curl-for-win'
year='2024'
# TODO: Switch to ECC once OpenSSL got support for deterministic ECDSA nonces
../mk-cert-code.sh "${name}" "${year}" rsa

cp -p "${name}_${year}-ca-cert.pem" ../curl-for-win-ca-cert.pem
cp -p "${name}_${year}-code.p12.asc" ../sign-code.p12.asc

# 2. GPG package signing key

name='curl-for-win-release-test'
mail="${name}@localhost"
../mk-gpg-sign.sh '' "${name}" "${mail}"

cp -p "${mail}-sign-public.asc" ../sign-pkg-public.asc
cp -p "${mail}-sign-private_gpg.asc" ../sign-pkg.gpg.asc

# 3. SSH deploy key

../mk-ssh-curl-for-win.sh

mv deploy.key.asc ..
)