From 19baed195dab9f56cb58cebd9509e6500dedf084 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20Peliz=C3=A4us?= Date: Thu, 28 Mar 2024 12:03:22 +0100 Subject: [PATCH] bin/helpers: Add createCertificateAndKey to create a new keypair MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julian Pelizäus --- bin/helpers | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bin/helpers b/bin/helpers index 4458e1ed2..18111492f 100644 --- a/bin/helpers +++ b/bin/helpers @@ -165,6 +165,14 @@ createPowerFlexPool() ( powerflex.user.password="${POWERFLEX_PASSWORD}" ) +# createCertificateAndKey: creates a new key pair. +createCertificateAndKey() ( + key_file="${1}" + crt_file="${2}" + cn="${3}" + openssl req -x509 -newkey ec -pkeyopt ec_paramgen_curve:secp384r1 -sha384 -keyout "${key_file}" -nodes -out "${crt_file}" -days 1 -subj "/CN=${cn}" +) + # cleanup: report if the test passed or not and return the appropriate return code. cleanup() { set +e