3 #hmmm: NOT ported to testkit yet.
5 # creates a new certificate based on the grid's signing cert.
7 # Author: Chris Koeritz
13 export WORKDIR="$( \cd "$(\dirname "$0")" && \pwd )" # obtain the script's working directory.
15 # pull in the xsede test base support.
16 source "$WORKDIR/../prepare_tools.sh" "$WORKDIR/../prepare_tools.sh"
18 # if that didn't work, complain.
19 if [ -z "$TESTKIT_SENTINEL" ]; then echo Please run prepare_tools.sh before testing.; exit 3; fi
21 # load the bash libraries we need.
22 source "$TESTKIT_ROOT/library/helper_methods.sh"
23 #source "$TESTKIT_ROOT/library/runner_functions.sh"
24 source "$TESTKIT_ROOT/library/security_management.sh"
29 echo "this script needs 7 parameters:"
30 echo "1: signing cert PFX file to base new cert on."
31 echo "2: the password for the signing cert PFX."
32 echo "3: the alias of the key to use within the signing PFX."
33 echo "4: output file to create with new certificate in PFX format."
34 echo "5: password for new certificate PFX file."
35 echo "6: alias for the certificate within the PFX file."
36 echo "7: Common Name (CN) of the identity signified by the new certificate."
38 echo "This is an example run using a signing cert for a container:"
40 echo 'bash $TESTKIT_ROOT/library/gen_cert_from_ca.sh signing-cert.pfx signer signing-cert $HOME/new_cert.pfx myPassword certalias "Fred Powers"'
44 signing_cert="$1"; shift
45 signing_passwd="$1"; shift
46 signing_alias="$1"; shift
47 output_file="$1"; shift
48 output_passwd="$1"; shift
49 output_alias="$1"; shift
52 create_pfx_using_CA "$signing_cert" "$signing_passwd" "$signing_alias" "$output_file" "$output_passwd" "$output_alias" "$output_cn"
53 check_if_failed "generating '$output_file' from '$signing_cert'"
55 echo "New certificate was generated into: $output_file"