Skip to content

Commit

Permalink
bin/helpers: Add createCertificateAndKey to create a new keypair
Browse files Browse the repository at this point in the history
Signed-off-by: Julian Pelizäus <[email protected]>
  • Loading branch information
roosterfish committed Mar 28, 2024
1 parent a69a570 commit 19baed1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions bin/helpers
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 19baed1

Please sign in to comment.