-
Bug
-
Resolution: Unresolved
-
Minor
-
None
plugin version 1.18
I am trying to use this certificate binding but in a simple job :
keystore variable: CERTSTORE
Alias Variable: MYKEY
step as a standard shell script:
keytool -list -v -keystore $CERTSTORE echo $MYKEY keytool -export -alias "$MYKEY" -keystore "$CERTSTORE" -rfc -file fit-kernel.cert
output us
+ keytool -list -v -keystore **** Enter keystore password: ***************** WARNING WARNING WARNING ***************** * The integrity of the information stored in your keystore * * has NOT been verified! In order to verify its integrity, * * you must provide your keystore password. * ***************** WARNING WARNING WARNING ***************** Keystore type: JKS Keystore provider: SUN Your keystore contains 1 entry Alias name: 1 Creation date: Sep 12, 2019 Entry type: PrivateKeyEntry ******************************************* ******************************************* + echo + LANG=C + keytool -export -alias '' -keystore **** -rfc -file fit-kernel.cert Enter keystore password: ***************** WARNING WARNING WARNING ***************** * The integrity of the information stored in your keystore * * has NOT been verified! In order to verify its integrity, * * you must provide your keystore password. * ***************** WARNING WARNING WARNING ***************** keytool error: java.lang.Exception: Alias <> does not exist
"$MYKEY" should exists but is not defined as an environment variable, I can't access my certificate.
I see a similar result with Jenkins ver. 2.190.3, Credentials Binding Plugin 1.20, and Credentials Plugin 2.3.0. I defined a step like this in a declarative pipeline Jenkinsfile:
and, what was written to AndroidSigningKeyAlias.txt was not the "keystore alias name" documented in https://jenkins.io/doc/pipeline/steps/credentials-binding/, but instead the description of the credential. The keystore alias name was actually the same as in the PKCS#12 file from which I had imported the credential to Jenkins.
CertificateMultiBinding#bind:
I guess the original reporter had not added a description to the credential, and the alias variable was thus left empty.