+ A certificate chain containing one or more PEM encoded certificates.
+ The certificates must be in order such that each one directly certifies the preceding one.
+ The certificate, for which the private key will be entered below must appear first.
+
The entry should look something like the following:
+
+-----BEGIN CERTIFICATE-----
+Base64 encoded contents
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+Base64 encoded contents
+-----END CERTIFICATE----
+
\ No newline at end of file
diff --git a/src/main/resources/com/cloudbees/plugins/credentials/impl/CertificateCredentialsImpl/PEMEntryKeyStoreSource/help-privateKey.html b/src/main/resources/com/cloudbees/plugins/credentials/impl/CertificateCredentialsImpl/PEMEntryKeyStoreSource/help-privateKey.html
new file mode 100644
index 000000000..49c7226fd
--- /dev/null
+++ b/src/main/resources/com/cloudbees/plugins/credentials/impl/CertificateCredentialsImpl/PEMEntryKeyStoreSource/help-privateKey.html
@@ -0,0 +1,32 @@
+
+
+
+ A single PEM encoded private key that is the key for the primary certificate entered above.
+
The entry should look something like the following:
+
+-----BEGIN PRIVATE KEY-----
+Base64 encoded contents
+-----END PRIVATE KEY-----
+
\ No newline at end of file
diff --git a/src/main/resources/com/cloudbees/plugins/credentials/impl/CertificateCredentialsImpl/UploadedKeyStoreSource/config.jelly b/src/main/resources/com/cloudbees/plugins/credentials/impl/CertificateCredentialsImpl/UploadedKeyStoreSource/config.jelly
index feac2db35..f0f25d667 100644
--- a/src/main/resources/com/cloudbees/plugins/credentials/impl/CertificateCredentialsImpl/UploadedKeyStoreSource/config.jelly
+++ b/src/main/resources/com/cloudbees/plugins/credentials/impl/CertificateCredentialsImpl/UploadedKeyStoreSource/config.jelly
@@ -55,6 +55,11 @@
uploadedCertFileInput.onchange = fileOnChange.bind(uploadedCertFileInput);
}
function fileOnChange() {
+ // only trigger validation if the PKCS12 upload is selected
+ var e = document.getElementById("${fileId}");
+ if (e.closest(".form-container").className.indexOf("-hidden") != -1) {
+ return
+ }
try { // inspired by https://stackoverflow.com/a/754398
var uploadedCertFileInputFile = uploadedCertFileInput.files[0];
var reader = new FileReader();
diff --git a/src/main/resources/com/cloudbees/plugins/credentials/impl/CertificateCredentialsImpl/credentials.jelly b/src/main/resources/com/cloudbees/plugins/credentials/impl/CertificateCredentialsImpl/credentials.jelly
index 5e86264ed..28a479022 100644
--- a/src/main/resources/com/cloudbees/plugins/credentials/impl/CertificateCredentialsImpl/credentials.jelly
+++ b/src/main/resources/com/cloudbees/plugins/credentials/impl/CertificateCredentialsImpl/credentials.jelly
@@ -37,7 +37,7 @@