From 1662ee17d5b091994f593db86458f318695d06a5 Mon Sep 17 00:00:00 2001 From: James Nord Date: Mon, 8 Jul 2024 11:52:59 +0100 Subject: [PATCH] remove unused validation --- .../impl/CertificateCredentialsImpl.java | 32 ------------------- 1 file changed, 32 deletions(-) diff --git a/src/main/java/com/cloudbees/plugins/credentials/impl/CertificateCredentialsImpl.java b/src/main/java/com/cloudbees/plugins/credentials/impl/CertificateCredentialsImpl.java index 4e9cdead..18fe3c34 100644 --- a/src/main/java/com/cloudbees/plugins/credentials/impl/CertificateCredentialsImpl.java +++ b/src/main/java/com/cloudbees/plugins/credentials/impl/CertificateCredentialsImpl.java @@ -825,38 +825,6 @@ public FormValidation doCheckPrivateKey(@QueryParameter String value, } } - /** - * Checks all the values. - * - * @param certChain pem encoded list of certificates (possibly a secret) - * @param privateKey pem encoded private key (possibly a secret) - * @param password for the key (may be null, and possibly a secret) - * @return the {@link FormValidation} results. - */ - public FormValidation doXXCheckCertChain(@QueryParameter String certChain, - @QueryParameter String privateKey, - @RelativePath("..") - @QueryParameter String password) { - String certs = Secret.fromString(certChain).getPlainText(); - String key = Secret.fromString(privateKey).getPlainText(); - String pass = Secret.fromString(password).getPlainText(); - if (StringUtils.isBlank(certs)) { - return FormValidation.error(Messages.CertificateCredentialsImpl_PEMNoCertificates()); - } - if (StringUtils.isBlank(key)) { - return FormValidation.error(Messages.CertificateCredentialsImpl_PEMNoKey()); - } - // pass will always be blank see JENKINS-65616 - if (StringUtils.isBlank(pass)) { - return FormValidation.error(Messages.CertificateCredentialsImpl_PEMNoPassword()); - } - try { - KeyStore ks = PEMEntryKeyStoreSource.toKeyStore(certs, key, pass.toCharArray()); - return validateCertificateKeystore(ks, pass.toCharArray()); - } catch (GeneralSecurityException | IOException e) { - return FormValidation.warning(e, Messages.CertificateCredentialsImpl_LoadKeystoreFailed()); - } - } } }