Files
rocm-systems/projects/rdc/authentication/01gen_root_cert.sh
T
systems-assistant[bot] c2312be1a2 Add 'projects/rdc/' from commit '5ae7eeb3550d4cb14cbc31d3022e545b054f1ad1'
git-subtree-dir: projects/rdc
git-subtree-mainline: a68afa42a1
git-subtree-split: 5ae7eeb355
2025-07-22 22:52:37 +00:00

31 regels
812 B
Bash
Executable File

#!/bin/bash
# This script should be called only once to generate a root
# certificate
mkdir -p CA
pushd CA
mkdir private newcerts
chmod 700 private newcerts
# Our next step is to create a database for the certificates we will sign:
echo '01' >serial
touch index.txt
# openssl_part1.cnf
# Create the Root Certificate
# This call of openssl encrypts the keys
# openssl req -new -x509 extensions v3_ca -keyout private/rdc_cakey.pem \
# -out rdc_cacert.pem -days 3650 -config ../openssl.cnf
# This call of openssl does not encrypt the keys
openssl req -new -x509 -nodes -extensions v3_ca -keyout private/rdc_cakey.pem \
-out rdc_cacert.pem -days 3650 -config ../openssl.cnf
# This generates:
# A private key in private/rdc_cakey.pem
# A root CA certificate in rdc_cacert.pem (distribute to clients)
popd