|
|
|
@ -45,19 +45,19 @@ Examples:
|
|
|
|
|
openssl req -x509 -nodes -newkey rsa:2048 -keyout test.key -out test.crt -subj '/CN=test.com'
|
|
|
|
|
openssl pkcs12 -export -inkey test.key -in test.crt -passout pass: -out test.p12
|
|
|
|
|
|
|
|
|
|
# create a credential with id 'aws-access-key-csv', and file ~/.aws/keys/jenkins_accessKeys.csv:
|
|
|
|
|
# create a credential with id 'aws-access-key-csv', and file ~/.aws/keys/jenkins_accessKeys.csv:
|
|
|
|
|
|
|
|
|
|
${0##*/} my-certificate-keystore ~/Downloads/test.p12
|
|
|
|
|
${0##*/} my-certificate-keystore ~/Downloads/test.p12
|
|
|
|
|
|
|
|
|
|
# with a description, leaving the store and domain as the default global one:
|
|
|
|
|
|
|
|
|
|
${0##*/} my-certificate-keystore ~/Downloads/test.p12 '' '' 'My Certificate Keystore'
|
|
|
|
|
${0##*/} my-certificate-keystore ~/Downloads/test.p12 '' '' 'My Certificate Keystore'
|
|
|
|
|
|
|
|
|
|
# or piped from standard input:
|
|
|
|
|
|
|
|
|
|
# export KEYSTORE_PASSWORD, JENKINS_SECRET_STORE and JENKINS_SECRET_DOMAIN if using stdin but not using system global store
|
|
|
|
|
|
|
|
|
|
echo my-certificate-keystore=~/Downloads/test.p12 | ${0##*/}
|
|
|
|
|
echo my-certificate-keystore=~/Downloads/test.p12 | ${0##*/}
|
|
|
|
|
"
|
|
|
|
|
|
|
|
|
|
# used by usage() in lib/utils.sh
|
|
|
|
@ -88,13 +88,13 @@ create_credential(){
|
|
|
|
|
die "keystore file '$keystore' not found!"
|
|
|
|
|
fi
|
|
|
|
|
timestamp "Reading keystore file '$keystore'"
|
|
|
|
|
local keystore_contents
|
|
|
|
|
local keystore_contents
|
|
|
|
|
keystore_contents="$(base64 "$keystore")"
|
|
|
|
|
local domain_name="$domain"
|
|
|
|
|
if [ "$domain_name" = '_' ]; then
|
|
|
|
|
domain_name='GLOBAL'
|
|
|
|
|
fi
|
|
|
|
|
local xml="<com.cloudbees.plugins.credentials.impl.CertificateCredentialsImpl>
|
|
|
|
|
local xml="<com.cloudbees.plugins.credentials.impl.CertificateCredentialsImpl>
|
|
|
|
|
<scope>$domain</scope>
|
|
|
|
|
<id>$id</id>
|
|
|
|
|
<description>$description</description>
|
|
|
|
|